When a class implements to Comparable interface, what method must also be implemented?

  1. compareTo
  2. toString
  3. compare
  4. equals
Answer: 1 – CompareTo

Which of the following declaration is correct that MAX field never change?

  1. public static final int MAX = 100;
  2. public int MAX = 100;
  3. public int static final MAX = 100;
  4. public int MAX = 100;
  5. public static int MAX = 100;
Answer: 1

Leave a Reply

Your email address will not be published. Required fields are marked *