Oracle Certified Associate Java Se 8 Programmer · Free Practice Question Easy

Question 36

Consider the code:

What is the result ?

  • A

    The Compilation Fails

  • B

    null...false...0

  • C

    null...true...0

  • D

    ...false...0

Reveal correct answer

Correct answer: B

Explanation

Once we creates an object, every instance variable will be initialized with default values. The default value for String is null, for boolean is false and for int is 0.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need