hi all,
my sample code is like this.
I want to call the method Zdes(n) by using run() method of thread class.
I have wriiten the code as
But it is giving me Exception.How to avoid that?
Is there any other way to write this code.
Main idea is code in Zdes(n) should be added to a thread.
my sample code is like this.
Code:
public Classs X { int n[]=new int[10]; public void Xdes() { Z z=new Z(); z.Zdes(n); } public class Z { public void Zdes(n) { //3loops which iterare nearly 10000 time } }
I have wriiten the code as
Code:
public class Xdes() implements Runnable { int n[]=new int[10]; Z z=new Z(); t=new Thread(this,"H"); t.start(); } public void run() { z.Zdes(n); }
Is there any other way to write this code.
Main idea is code in Zdes(n) should be added to a thread.
Comment