943,545 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 8429
  • Java RSS
Nov 21st, 2008
0

countdown timer program

Expand Post »
Hi,
I am making a java program to make a countdown timer.
User enters time,then when time is up a message is printed.
How do I print the time on the same line?
Please tell me how to go about it.
Thanks.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
shubhang is offline Offline
25 posts
since Oct 2008
Nov 21st, 2008
0

Re: countdown timer program

read documentation on System.out.println()
Reputation Points: 46
Solved Threads: 11
Junior Poster
orko is offline Offline
164 posts
since Apr 2006
Nov 22nd, 2008
0

Re: countdown timer program

Sir,
I am new at java ,so I dont know where to look for it.
I searched my notes ,but didn't find anything.
Please tell me where to find it.
Thanks
Reputation Points: 10
Solved Threads: 0
Light Poster
shubhang is offline Offline
25 posts
since Oct 2008
Nov 22nd, 2008
0

Re: countdown timer program

Just use google. Type System.out.println() java, or you could also try Java IO. Also, an easy way to 'count' would be

// X
Thread.getThread().sleep(1000); //waits for 1 second.
//If you print out right here, you can be sure that the time is extremely close to 1 second from X
Reputation Points: 874
Solved Threads: 352
Posting Maven
BestJewSinceJC is offline Offline
2,758 posts
since Sep 2008
Nov 22nd, 2008
0

Re: countdown timer program

Just use google. Type System.out.println() java, or you could also try Java IO. Also, an easy way to 'count' would be

// Read in the amount of time you want to wait in seconds, call it "time"
Thread.getThread().sleep(time * 1000); //waits for 1 second if time = 1.
//Print out the time you waited.
Edited.
Reputation Points: 874
Solved Threads: 352
Posting Maven
BestJewSinceJC is offline Offline
2,758 posts
since Sep 2008
Nov 22nd, 2008
0

Re: countdown timer program

Click to Expand / Collapse  Quote originally posted by shubhang ...
Sir,
I am new at java ,so I dont know where to look for it.
I searched my notes ,but didn't find anything.
Please tell me where to find it.
Thanks
you'll be able to find it in the basic Java resources: the api's
Reputation Points: 919
Solved Threads: 352
Nearly a Posting Maven
stultuske is offline Offline
2,471 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Exception in thread "main" java.lang.StackOverflowError
Next Thread in Java Forum Timeline: Merge sort problem.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC