Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mock question

 
Shiva Mohan
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,

javabeat mock question

Which of the following statements are true?

A) An inner class cannot be defined as private.
B) Static methods can be overridden by static methods only
C) Static variables can be called using class name.----------
D) Non static variables can be called using class name.

the given answer is C.But why B option is not included?
 
Anton Uwe
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because you cannot "override" static methods...
 
Shiva Mohan
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah Anton. i forgot while attending the mock test that static methods are just hidden(not override) concept.

Thanks for the help.
 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is option A wrong in the following code I marked a inner Class private

 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you read the wording carefully in A, an inner class cannot be defined as private, the statement is false. The question asked which of the statements is true.
 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keith,

You're right. Sorry for my misreading.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic