0
What's wrong with this code.
class Sample extends Thread { String s; Sample(String n) { this.n = s; } public void run() { System.out.println("Hello "+s); } } class Loader { public static void main(String args[]) { Sample ob1 = new Sample("David Beckham"); Sample ob2 = new Sample("Cristiano Ronaldo"); ob1.start(); ob2.start(); } }
1 Respuesta
0
Solved by self. (this.n=s;)