Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
jb7.0 extends.override
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { System.out.println("Hello, World!"); A a = new A(); B b = new B(); A c = new B(); a.show(); b.show(); c.show(); b.show("+"); //c.show("++"); //err } } class A { public void show(){ System.out.println("A:show()"); } } class B extends A { int l = 10; public void show(){ System.out.println("B:show() " + l); } public void show(String msg){ System.out.println("B:show(String msg) " + msg); } }
run
|
edit
|
history
|
help
0
final method
rextester.java1
4.d
Implement Queue with Limited Size of Arrays
"Naive" recursion vs. Dynamic Programming
luas
Firstproject
Size and signedness of Java ints and longs
Inheritance
Feet-inches input validation