0

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.

4
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by stultuske
0

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

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

0

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.

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.