Created
November 6, 2014 06:35
-
-
Save objmagic/76eb90c136605495f5b9 to your computer and use it in GitHub Desktop.
Overloading
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Main { | |
public static void main(String[] a){ | |
System.out.println(1); | |
} | |
} | |
class A { | |
public int run() { | |
int x; | |
x = 1; | |
return x; | |
} | |
} | |
class B extends A { | |
public boolean run() { // TE | |
int x; | |
x = 1; | |
return x; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Main { | |
public static void main(String[] a){ | |
System.out.println(1); | |
} | |
} | |
class A { | |
public int run() { | |
int x; | |
x = 1; | |
return x; | |
} | |
} | |
class B extends A { | |
public int run(int y) { // TE | |
int x; | |
x = 1; | |
return x; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment