Java OCA OCP Practice Question 253

Question

What are the legal types for whatsMyType?

short s = 10; 
whatsMyType = !s; 
  • A. short
  • B. int
  • C. There are no possible legal types.


C.

Note

The expression !s won't compile, because the ! operator may be applied only to booleans.




PreviousNext

Related