Home / MCQ Bank / Computer
Computer Data Types And Variables

How to convert a String to a Date object?

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option A • SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); sdf.parse(new Date())

Related Computer Questions

Which of the following is not the correct syntax for creating a set? Which of the following is the first component of e-mail? In C++, what is the process of creating a new class using an existing class as a blueprint and adding new functionalities to it? What could be output of the following fragment of code? public class Test{ public static void main(String args[]){ String x = "hellow"; int y = 9; System.out.println(x += y); } } What is the output of the given code? counter=1 if counter<=5 puts (counter) counter=counter+1