Bapa

Untitled

Mar 17th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.33 KB | None | 0 0
  1.  
  2. public class MyThread implements Runnable
  3. {
  4.    String myString = "Yes ";
  5.  
  6.    public void run()
  7.    {
  8.      this.myString = "No ";
  9.    }
  10.  
  11.    public static void main(String[] args)
  12.    {
  13.      MyThread t = new MyThread();
  14.      new Thread(t).start();
  15.  
  16.      for (int i=0; i < 10; i++)
  17.       System.out.print(t.myString);
  18.    }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment