954,157 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

countdown timer program

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.

shubhang
Light Poster
25 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 

read documentation on System.out.println()

orko
Junior Poster
164 posts since Apr 2006
Reputation Points: 46
Solved Threads: 11
 

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

shubhang
Light Poster
25 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 

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

BestJewSinceJC
Posting Maven
2,772 posts since Sep 2008
Reputation Points: 874
Solved Threads: 354
 

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.

BestJewSinceJC
Posting Maven
2,772 posts since Sep 2008
Reputation Points: 874
Solved Threads: 354
 
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

stultuske
Posting Sensei
3,110 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 432
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You