Produced Output as
sub static
Superclass arg
Subclass no-arg
I have written a code to call SuperClass satic method; I know that SuperClass static methods cannot be overriden but what happens with this line super(method()); of code
When you call a static method without qualification it's going to look in the current class. If you want to call the superclass version here you need to qualify it: SuperClass.method().
please use code tags if you want to post any code snippet.
and in your code method() has a return type of int ,so super(method()) passes 5 value to superclass constructor.