Java Quiz 3 : Data Types

    Welcome to your Java Quiz 3 : Data Types

    1. Which of the following is not provided by BigDecimal?
    2. BigDecimal is a part of which package?
    3. What is BigDecimal.ONE?
    4. Which class is a library of functions to perform arithmetic operations of BigInteger and BigDecimal?
    5. What will be the output of the following Java code snippet?
    1. public class AddDemo 
    2. {
    3.  public static void main(String args[]) 
    4.  {
    5.  BigDecimal b = new BigDecimal("23.43");
    6.  BigDecimal br = new BigDecimal("24");
    7.  BigDecimal bres = b.add(new BigDecimal("450.23"));
    8.  System.out.println("Add: "+bres);
    9.  
    10.  MathContext mc = new MathContext(2, RoundingMode.DOWN);
    11.  BigDecimal bdecMath = b.add(new BigDecimal("450.23"), mc);
    12.  System.out.println("Add using MathContext: "+bdecMath);
    13.  }
    14. }
    6. How to format date from one form to another?
    7. How to convert Date object to String?
    8. How to convert a String to a Date object?
    9. Is SimpleDateFormat thread safe?
    10. How to identify if a timezone is eligible for DayLight Saving?
    11. What is the replacement of joda time library in java 8?
    12. How is Date stored in database?
    13. What does LocalTime represent?
    14. How to get difference between two dates?
    15. How to get UTC time?