Method (computer programming): Difference between revisions

Content deleted Content added
Line 26:
public class class2 extends class1 {
@Override
int f(int x) { // overriding {
return x*x;
}
int f(int x, int y) { // overloading
return x*y;
}