Reputation: 43
iam a newbie in java and i have a task at hand to make a simple application in java for countdown.
like for ex in that application if i enter the current date it should display how much time is left for christmas or a newyear or any religious occassion ...............
and it should display the result in the format like years/months/days/hours/minutes and seconds........
plz help me for how to go with this...............
thanks in advance.
Upvotes: 0
Views: 463
Reputation: 114767
The task is pretty straightforward. You need solutions for the steps
Scanner
class, includes presenting a message to the userDate
(includes rejecting invalid data)1., 2. and 4. can be done in the main method, for 3. I'd implement a separate method. like private static Date getDistance(Date earlier, Date later)
Upvotes: 0
Reputation: 64632
First start with a hello world tutorial. After that move on joda time library since it's much more usable than the standard Java time/date/calendar. If you need further help do not hesitate to post a question here.
Upvotes: 2
Reputation: 3118
How to go?
Let the user input the date, Calculate the difference from the inputted date to the occasions-dates and output them
The dates of the occassions you can put in a properties file that you read on launching the application
See Formatting dates for formatting
Upvotes: 0