Basic Datatypes


  1. How to get difference between two dates?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Java 8 provides a method called between which provides Duration between two times.


  1. What does LocalTime represent?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    LocalTime of joda library represents time without date.



  1. What is the range of short data type in Java?











  1. View Hint View Answer Discuss in Forum

    Short occupies 16 bits in memory.

    Correct Option: B

    Short occupies 16 bits in memory. Its range is from - 215 to 215 - 1
    i.e. -32768 to 32767.


  1. What is the replacement of joda time library in java 8?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    In java 8,we are asked to migrate to java.time (JSR-310) which is a core part of the JDK which replaces joda library project.



  1. How to identify if a timezone is eligible for DayLight Saving?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    public abstract boolean useDaylightTime() is provided in TimeZone class.