Solved

How to get the next day in Java?

Posted on 2010-08-27
2
721 Views
Last Modified: 2013-12-14
Hi I'm working with dates in Java in format of ddmmyyyy and mmddyyyy. Currently I'm working with strings only and I wany to use Java objects instead. I need these features from the object:

1. I need the ability to get a string represantaion of the Object as dd/mm/yyyy or mm/dd/yyyy.
2. I need to be able to get the next day in  the calendar (the input should be such a Java object)
3. Is this object Comparable? i.e Can I insert it to a tree map and it will be sorted accordingly?

What object should I use and how?

Thanks!
0
Comment
Question by:HPBSM
2 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 33543093
1. Use a DateFormat
2. Use Calendar.add
3. Yes, Date is Comparable - you'd use that. It's the *keys* of a tree map that are sorted
0
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 33546122
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
simple java question 3 55
what is a "java.lang.System Property"   ? 20 65
servlet doXXX methods 3 48
servlet filter example 37 58
This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question