An exercise about overriding/overloading:
Which methods can be inserted at line 1 and line 2 for the code to compile and run
without error?
publicclass MyClass{
publicstaticvoid main(String[] argv){
}
void amethod(int i){
}
//line 1
}
class MySubclassextends MyClass{
// line 2
}
Here are the methods:
1- protected void amethod(int i) throws Exception {}
2- public int amethod(int i) {return 0;}
3- void amethod(int i) throws RuntimeException{}
4- private int amethod(int i) {return 0;}
The method to be inserted at Line 2 is obvious but for Line 1? Thanks for the help.

