Find Jobs
Hire Freelancers

Clock

$2-7 USD

Completed
Posted over 20 years ago

$2-7 USD

Paid on delivery
Implement a 1000ms clock thread Using the Observer/Observable classes create a number of listener objects that output the clock tick value each time the clock thread ticks Interface [login to view URL] has one method -- update Listener objects which implement Observer put their application logic in the update method body Class [login to view URL] serves as a base class to objects which emit periodic events to Observers. Invoke methods addObserver, and notifyObsevers in the base class to use the functionality Beware the ‘hasChanged()’ side-effect of notifyObservers! Question: How many threads are running in this exercise? Which objects run on which threads? ## Deliverables Use the following code as a starting point. import java.util.*; class Main { public static void main (String[] args){ Clock clock; int clockCycle, limit; if ([login to view URL] != 2) { [login to view URL]("usage: clockCycle limit"); [login to view URL](" clockCycle is the length, in milliseconds, of each clock tick"); [login to view URL](" limit is the number of clock ticks until all threads exit"); [login to view URL](" good values are 1000 for clockcycle, 10 for limit"); [login to view URL](-1); } clockCycle = new Integer(args[0]).intValue(); limit = new Integer(args[1]).intValue(); /* Create a new Clock object and a number of ClockWatchers to watch it. Start the clock's thread. */ } } class Clock ??? { } class ClockWatcher ???? { ] ## Platform Windows
Project ID: 3016118

About the project

2 proposals
Remote project
Active 20 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
See private message.
$2 USD in 3 days
0.0 (1 review)
0.0
0.0
2 freelancers are bidding on average $5 USD for this job
User Avatar
See private message.
$8.50 USD in 3 days
4.9 (6 reviews)
2.1
2.1

About the client

Flag of UNITED STATES
United States
5.0
11
Member since Feb 6, 2003

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.