• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

modifiers for class variables

 
Kareem Qureshi
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is a question from certification4career
19)
A class variable is declared using following modifiers
a.protected
b.private
c.public
d.static
can anybody tell me why answers a,b,c along with d are not valid. or i am missing something here?
i am talking of public static int a = 1; or private static int a = 1;
thanks in advance
kareem
 
Marilyn de Queiroz
Sheriff
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"A class variable is declared using following modifiers "

I think they meant the question to read more like, "Which modifier creates a variable which is a class variable".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic