MCQs>IT & Programming>Java>Which code snippets will take transform input string '2012/06/05' to output string '05 - 06 - 2012'?
Java MCQs
Which of the following code snippets will take transform input string "2012/06/05" to output string "05 - 06 - 2012"?
Answer
Correct Answer: String dateString = "2012/06/05"; Date date = new SimpleDateFormat("yyyy/MM/dd").parse(dateString); SimpleDateFormat sdf = new SimpleDateFormat("dd - MM - yyyy"); System.out.println(sdf.format(date));
Explanation:
Note: This Question is unanswered, help us to find answer for this one