How can I get the last date of the previous month in java ? For example if the date entered is 1/4/2007,the I should get the output as 31/3/2007.Code snippet for this would really help.
Well, in the big picture its going to help you less (see this)
Have a look at the Calendar class and notice that there are methods to rollback a calender by a particular amount for a particular field (minute, hour, day, year etc.). Also notice there are methods to get the maximum value a particular field can hold.