fork download
  1. class ejemplo3 extends thread{
  2. public ejemplo3(String str){
  3. super(str);
  4. }
  5. public void run(){
  6. for(int i=0;i<10;i++)System.out.println(i+""+getName());
  7. System.out.println("termina hilo" +getName());
  8. }
  9. public static void main(String[] args){
  10. new ejemplo3("java").start();
  11. new ejemplo3("c++").start();
  12. System.out.println("inicio hilo principal");
  13. }
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: cannot find symbol
symbol: class thread
class ejemplo3 extends thread{
                       ^
Main.java:6: cannot find symbol
symbol  : method getName()
location: class ejemplo3
for(int i=0;i<10;i++)System.out.println(i+""+getName());
                                             ^
Main.java:7: cannot find symbol
symbol  : method getName()
location: class ejemplo3
System.out.println("termina hilo" +getName());
                                   ^
Main.java:10: cannot find symbol
symbol  : method start()
location: class ejemplo3
new ejemplo3("java").start();
                    ^
Main.java:11: cannot find symbol
symbol  : method start()
location: class ejemplo3
new ejemplo3("c++").start();
                   ^
5 errors
stdout
Standard output is empty