Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
problem 11: java program 11
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; class MyThread extends Thread { MyThread(){ System.out.print(" MyThread"); } public void run(){ System.out.print(" bar"); } public void run(String s){ System.out.print(" baz"); } } class Rextester{ public static void main(String args[]) { Thread t = new MyThread() { public void run() { System.out.println(" foo"); } }; t.start(); } }
run
|
edit
|
history
|
help
0
PE #4
Wenfeng Ou
updated
Test
Basic
java polymorhism
Java Q4
Main.java
t-primes
1a