Find Jobs
Hire Freelancers

Clock

$2-7 USD

已完成
已发布超过 20 年前

$2-7 USD

货到付款
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
项目 ID: 3016118

关于此项目

2提案
远程项目
活跃20 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
See private message.
$2 USD 在3天之内
0.0 (1条评论)
0.0
0.0
2威客以平均价$5 USD来参与此工作竞价
用户头像
See private message.
$8.50 USD 在3天之内
4.9 (6条评论)
2.1
2.1

关于客户

UNITED STATES的国旗
United States
5.0
11
会员自2月 6, 2003起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。