Method (computer programming): Difference between revisions

Content deleted Content added
Line 24:
class Class1 {
int f(int x) {
return x + 3;
}
}
Line 31:
@Override
int f(int x) { // overriding
return x * x;
}
int f(int x, int y) { // overloading
return x * y;
}
}