madhawaseeeee

threading...

Sep 18th, 2018
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. public class thread_example1 implements Runnable {
  2.     @Override
  3.     public void run() {
  4.     }
  5.     public static void main(String[] args) {
  6.         Thread guruthread1 = new Thread();
  7.         guruthread1.start();
  8.         try {
  9.             guruthread1.sleep(1000);
  10.         } catch (InterruptedException e) {
  11.             // TODO Auto-generated catch block
  12.             e.printStackTrace();
  13.         }
  14.         guruthread1.setPriority(1);
  15.         int gurupriority = guruthread1.getPriority();
  16.         System.out.println(gurupriority);
  17.         System.out.println("Thread Running");
  18.   }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment