Mohamed Sanaulla | My Blog | Author of Java 9 Cookbook | Java 11 Cookbook
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
sureshkumar settu wrote:
what about this overriding
class X{
protected long process(int x){}
}
class Y extends X{
protected int process(int x){} // as per your explanation i think i understand it well, if i am right here. this is legal overriding
}
...
Am i right here???![]()
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
sureshkumar settu wrote:You missed some thing i didn't mention Long (object) that is long (primitive). I think you missed it.
I know about box - and - widen rules that's not a problem.
my doubt is simple
can i put sub class return type as int when super class return type is long (primitive).