QuestionQ228

Working with Java Data Types

Given:

Question Image

What is the resulting output?

  • A c=null b=true f=0.0
  • B c= b=false f=0.0
  • C c=null b=false f=0.0
  • D c=0 b=false f=0.0F
Explanation

Instance fields receive Java default values when they are not explicitly initialized: a char field has the null character value ('\u0000'), which prints with no visible character; a boolean field is false; and a float field is 0.0f, displayed as 0.0.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!