Java OCA OCP Practice Question 542

Question

Which of the following are true?

Choose all that apply

  • A. An instance variable of type boolean defaults to false.
  • B. An instance variable of type boolean defaults to true.
  • C. An instance variable of type boolean defaults to null.
  • D. An instance variable of type int defaults to 0.
  • E. An instance variable of type int defaults to 0.0.
  • F. An instance variable of type int defaults to null.
  • G. None of the above.


A, D.

Note

Options A and D are correct because boolean primitives default to false and int primitives default to 0.




PreviousNext

Related