• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

overriding access

 
Jasper Vader
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is an answer that was to today's question at examulator... i have an issue with number 4.
1) To be overridden a method must have the same name, parameter types and return type.
To be overriden the return type does matter

3) classes that are marked as final may not be overriden
4) an overriding method cannot have more access (be more public) than the method being overriden
... what's that again? i thought that an overriding method HAD to have more public or equal access than the overridden method?
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct.
 
Jasper Vader
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...and examulator is wrong? if so, i must email them and inform them.
 
Jasper Vader
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, well, they are wrong really. so yes i will email them.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic