I get them but i don't understand why our professor says that this is override. Shouldn't it be override since the parameter type is different than that of the same method with the same name?
public void stuff(char x) { // overloading? overriding?
System.out.println("x is a char in overRide");
}
I provided some code below for the context
class OverLoad {
public int xyz = 9;
public void stuff(int x) {
System.out.println("x is an int in OverLoad");
}
public void stuff(double x) {
System.out.println("x is a double in OverLoad");
}
}
class OverRide extends OverLoad {
public int xyz = 99; // don't do this! creates confusion public void
stuff(char x) { // overloading? overriding?
System.out.println("x is a char in overRide");
}
public void stuff(int x) {
System.out.println("x is an int in overRide");
System.out.println("call parent stuff(int x)");
super.stuff(x);
}
}