[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to get the next day in Java?

Posted on 2010-08-27
2
Medium Priority
?
730 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 total points
ID: 33546122
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

Upgrading Tomcat – There are a couple of methods to upgrade Tomcat is to use The Apache Installer is to download and unzip and run the services.bat remove|install Tomcat6 Because of the App that we are working with, we can only use Tomcat 6.…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
Suggested Courses

649 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