Java tutorial
class ThreadDemo extends Thread { public void run() { System.out.println("Thread priority = " + getPriority()); } } public class Main { public static void main(String args[]) { Thread t = new Thread(new ThreadDemo(), "java2s.com thread"); t.setPriority(1); System.out.println("thread = " + t); t.start(); } }