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

Is void a data type?

544


What is one third plus one third as a fraction?

494


What is the final variable?

587


Discuss different types of errors that generally occur while programming.

585


Explain how to force the garbage collection in java.

543






Can vector have duplicates in java?

516


Can you extend singleton class?

612


What are the object and class classes used for?

574


What exactly is java?

521


java program with complete 4 oops concepts implemented example

2735


List the different types of classloaders in java.

513


Explain what do you mean by functional overloading in java?

562


Can we initialize the final blank variable?

598


Is upper case in java?

539


Why declare Main() method as a static in java ?

607