• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mind Q Question

 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Mind Q (at least the version giving with the Oracle Self Learning CDs) is the following question
Child is a subclass of Super, the following are a legal declarations.
Super super = new Child();
Child child = new Child();
The answer given is true but, I believe it should be false since super is a keyword and cannot be used as an idenitifier. If they had used _super or any other modification, it would be true.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup. Good call.
 
john shen
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jim, i wonder if you could comment on this observation of mine. in cases like this in real exam, would it be safer to assume that the objective of the question is to test you the concept of inheritance and thus expect you to pick the one shown here, even if it is actually wrong? i hope nobody runs into this type of dilemma, but someone could, right? thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic