This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
I�ve seen lots of examples in which the authors use the SimpleDateFormat class to format date�s presentation,but that�s not what I want.What I really want is to transform a String in a Date object,and I�d be very thankful if someone could help me in doing this
I will end up obtaining a String,but all I need is simply to convert an object of one type(String) to another one(Date)
Your code does exactly that, convert a String to a Date object. What is it that you don't understand?
If you print the Date object after parsing it by just doing a System.out.println(d); then the Date will ofcourse be converted back to a string automatically, because it needs to be in a string format to be displayed on the screen. If you don't specify how the Date object should be formatted, then the toString() method of class Date is called automatically which uses a default format, so that you get:
Mon Jan 24 00:07:00 BRT 1983
Do you understand that a Date object is just a Date object - it doesn't have any implicit formatting.