Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to convert mm/dd/yy to dd/mm/yy using collections in
java.

Answer Posted / sankar

Hi, Here is the Program


import java.util.Date;
import java.text.SimpleDateFormat;


class DateConversion{

public static void main(String ar[])throws Exception
{

String strDate = "06/12/2008";

SimpleDateFormat srcDate = new SimpleDateFormat
("mm/dd/yyyy");
SimpleDateFormat destDate = new SimpleDateFormat
("dd/mm/yyyy");

System.out.println(destDate.format
(srcDate.parse(strDate)));

}
}

Is This Answer Correct ?    19 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the meaning of I ++ in java?

1099


What is the difference between iterator and enumeration ?

955


What is a classloader in java?

956


What steps are taken when the OS shifts from one-thread execution to another?

1312


What do you mean by Function Overloading in java?

1125


What is this keyword used for?

1065


Is array a class in java?

924


What is a treeset in java?

989


What are the different collection views provided by maps?

931


Is null a string?

945


What are the restriction imposed on a static method or a static block of code?

996


what is difference between equals and ==?

997


Can we use catch statement for checked exceptions?

914


Is string a class?

969


Which is better ascii or unicode?

938