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

Search Java Interview Questions


 2098 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Label / Company      Label / Company / Text

   



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

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

java.util.Calendar c = new java.util.Calendar();
Core Java
Admin
info@buggybread.com
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
Admin
info@buggybread.com
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
Admin
info@buggybread.com
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 ?
Admin
info@buggybread.com
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 ?
Admin
info@buggybread.com
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




Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

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:
         

X Close this

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: