Core Java - Interview Questions and Answers for 'Calendar' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

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

   



Core Java - Interview Questions and Answers for 'Calendar' - 5 question(s) found - Order By Rating

 Q1. Will this code Work ? If not , Why ?

java.util.Calendar c = new java.util.Calendar();
Core Java
Ans. No. It gives the error "Cannot Instantiate the type Calendar". Calendar is an abstract class and hence Calendar object should be instantiated using Calendar.getInstance().

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   date   calendar   abstract class   yes-no


 Q2. Is java.util.Date an abstract Class ? Is java.util.Calendar an abstract Class ?Core Java
Ans. Date is not a abstract class whereas Calendar is.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   date   calendar   abstract class


 Q3. What will the following code print ?

java.util.Calendar c = java.util.Calendar.getInstance();
c.add(Calendar.MONTH, 5);
System.out.println(c.getTime());
Core Java
Ans. Date and Time after 5 months from now.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   date   calendar   scjp   ocjp   coding   code


 Q4. Name few Calendar related classes and Interfaces ?
Ans. http://www.buggybread.com/2015/02/java-util-calendar-classes-and.html

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   util   java.util   calendar


 Q5. What is GregorianCalendar class ?
Ans. This class provides support for traditional Western calendars.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     GregorianCalendar   Calendar   util   core java        rare



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: