Which of the following code is correct ?
a. Date date = DateFormat.newInstance(DateFormat.LONG, Locale.US).parse(str);
b. Date date = DateFormat.newInstance(DateFormat.LONG, Locale.US).format(str);
c. Date date = DateFormat.getDateInstance(DateFormat.LONG, Locale.US).parse(str);
Questions
Search
List By Company
List By Topic
Legacy
Tests
Repository
DashBoard
Java
Java 8
Java 7
Java Abbreviations
OCJP / SCJP
Class List
New in Java 8
Java Exceptions
Spring Exceptions
Java Enums
Java 8 Lambda
Java 8 java.time
Big Data
Best Of Java
Discussion
Search
Subscribe
Search Interview Questions
More than 3000 questions in repository.
There are more than 900 unanswered questions.
Click here
and help us by providing the answer.
Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company
Label / Company / Text
Search
Submit Question
Interview Questions and Answers
Q1.
Which of the following code is correct ?
a. Date date = DateFormat.newInstance(DateFormat.LONG, Locale.US).parse(str);
b. Date date = DateFormat.newInstance(DateFormat.LONG, Locale.US).format(str);
c. Date date = DateFormat.getDateInstance(DateFormat.LONG, Locale.US).parse(str);
Core Java
Ans. c
Help us improve. Please let us know the company, where you were asked this question
:
Like
Discuss
Correct / Improve
 java   java.util   date   dateformat
Correction
Duplicate of Another Question
Company where this question was Asked
Suggestion
Related Questions
If you are given a choice to implement the code to either Insert a Record or Update if already exist, Which approach will you follow ?
Within AWS S3, Why new files are available immediately for read operation but not the updates ?
Will this code Work ? If not , Why ?
Is java.util.Date an abstract Class ? Is java.util.Calendar an abstract Class ?
Which of the following code is correct ?
What is the use of parse method in DateFormat ?
Which of the following is not a valid NumberFormat initialization ?
What will the following code do ?
Name few Date and Time Classes you have used in your projects ?
Help us and Others Improve. Please let us know the questions asked in any of your previous interview.
Any input from you will be highly appreciated and It will unlock the application for 10 more requests.
Company Name:
Questions Asked: