Java OCA OCP Practice Question 1469

Question

Expression (s instanceof java.util.Date) will return false if 's' was declared as a variable of class java.lang.String.

Select 1 option

  • A. True
  • B. False


Correct Option is  : B

Note

It will not even compile because the compiler knows that 's' can NEVER refer to an object of class java.util.Date.




PreviousNext

Related