I have two question on this code
public class Override {
private void f() {
System.out.println(\"private f()\");
}
public static void mai
The override of method has three conditions.child class must has the same name and parameters and returned value as its super class.But if both of the parameter and returned value are vary,so the override is not exist!even if the two method are different method!ok!like this:
public class Parent {
public int addV(int a,int b){
int s;
s = a + b;
return s;
}
}
class Child extends Parent{
public void addV(){
//do...something
}
}
Eclipse will not talk error! because the method addV in class Child is different with the method addV in class Parent.As your instance!