class Base { public final int getNext(int i) { return ++i; } } public class Derived extends Base { public int getNext(int i) { return i++; } public static void main(String[] args) { int result = new Derived().getNext(3); System.out.print(result); result = new Base().getNext(3); System.out.print(result); } }
public final int getNext(int i) {
return ++i;
}
public class Derived extends Base {
public int getNext(int i) {
return i++;
public static void main(String[] args) {
int result = new Derived().getNext(3);
System.out.print(result);
result = new Base().getNext(3);
Oracle Certified Professional Java Programmer
Access: Public Instant Grading
Jobilize.com uses cookies to ensure that you get the best experience. By continuing to use Jobilize.com web-site, you agree to the Terms of Use.