• Post Reply Bookmark Topic Watch Topic
  • New Topic

accessing scheduler

 
murugesan subramani
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a
class A{
public int var_A;
public void run(){
try(){
doSomething();
Thread.sleep(130);
}catch (InterruptedException e){
}
}
}
public class demo{
private A [] a=new a[10];
public static void main(String [] args){
for(int i=0;i<10;i++){
a[i]=new a();
a[i].start();
}
}
}
now how do change the value of var_A in class A at every 625 milliseconds using a Timer.schedule method?
thanx
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!