Hi,
I think your program is like this:
class sup{
}
class sub extends sup{
void meth(){}
}
public class supsub{
public static void main(
String argv[] ){
sup s=new sub();
s.meth();
}
}
I do agree with rogers. And also if we say in other way,
you are making instance of sub class but type is sup i.e.
super class and your meth() method didn't find any equavalent method which it would override in super class. So meth() method is being created as a new method in your subclass not overridden
method in super class. So how come type super class works.
- Golam Newaz
- Golam Newaz
------------------