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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / sandya

Thanks Shankar.
can u send more examples on Date.

Is This Answer Correct ?    3 Yes 0 No

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

Answer / ravi jain

Dear Sankar ur ans is ok bur it has some mistakes

suppose if some one enter month value <12,
this program accept dis as well
can u modify dis so that it wouldn't accept
month value greater than 12...

Ravi jain

Is This Answer Correct ?    2 Yes 2 No

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

Answer / zaini

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

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More Core Java Interview Questions

What do you understand by Header linked List?

0 Answers   Genpact,


When try and catch block is used ?

6 Answers  


What primitive Java types? Howmany are they and what are their names?

3 Answers  


What are the differences between Java 1.0 and Java 2.0?

0 Answers  


Can list be final in java?

0 Answers  






can we create object for static class in java

14 Answers   IAP Company, IBM, Marlabs, mPortal, TCS,


Explain java coding standards for classes or java coding conventions for classes?

0 Answers  


What do you understand by a Static Variable?

0 Answers   CGI,


How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters in java programming?

0 Answers  


What means public static?

0 Answers  


Is jdk required on each machine to run a java program?

0 Answers  


What is a website container?

0 Answers  


Categories