Saturday, 9 March 2013

MCQ #4

Question) Member (instance) variables are always assigned a default value if not explicitly initialized.

Options)

  • True
  • False
Answer) True

Explanation) Go through the Java tutorial on Objects in java to know the difference between instance variables and local variables.As for our question, yes instance variables are assigned default values if not explicitly initialized.On the other hand compiler will complaint if local variables are used without initialization.

No comments:

Post a Comment

t> UA-39527780-1 back to top