A

Admin • 802.91K Points
Coach

Q. How to convert a String to a Date object?

  • (A) SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); sdf.parse(new Date());
  • (B) * operator has converted b * 50 into int, which can not be converted to byte without casting
  • (C) SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); new Date().parse();
  • (D) SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); new Date().format();
  • Correct Answer - Option(A)
  • Views: 6
  • Filed under category Java
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.