Home » JAVA Programming » Methods » Question
  1. Which of these exceptions is thrown by compareTo() method defined in a double wrapper?
    1. CastException
    2. ClassCastException
    3. SystemException
    4. IOException
    5. None of these
Correct Option: B

compareTo() methods compare the specified object to be double, if it is not then ClassCastException is thrown.



Your comments will be displayed only after manual approval.