aspose file tools*
The moose likes Beginning Java and the fly likes overriding access Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "overriding access" Watch "overriding access" New topic
Author

overriding access

Jasper Vader
Ranch Hand

Joined: Jan 10, 2003
Posts: 284
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?


giddee up
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
You are correct.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Jasper Vader
Ranch Hand

Joined: Jan 10, 2003
Posts: 284
...and examulator is wrong? if so, i must email them and inform them.
Jasper Vader
Ranch Hand

Joined: Jan 10, 2003
Posts: 284
yes, well, they are wrong really. so yes i will email them.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: overriding access