classKWextendsThread{publicvoidrun(){System.out.println(Thread.currentThread().getName()+" Server Is Running...");}publicstaticvoidmain(Stringargs[]){KWt1=newKW();KWt2=newKW();KWt3=newKW();t1.setName("MongoDB");t2.setName("MySQL");t3.setName("Cassandra");t1.setPriority(Thread.MAX_PRIORITY);t2.setPriority(Thread.NORM_PRIORITY);t3.setPriority(Thread.MIN_PRIORITY);System.out.println("Thread Priority T1 "+t1.getPriority());System.out.println("Thread Priority T2 "+t2.getPriority());System.out.println("Thread Priority T3 "+t3.getPriority());t1.start();t2.start();t3.start();}}
Output
kodingwindow@kw:~$ javac KW.java kodingwindow@kw:~$ java KW
Thread Priority T1 10
Thread Priority T2 5
Thread Priority T3 1
MongoDB Server Is Running...
MySQL Server Is Running...
Cassandra Server Is Running...
kodingwindow@kw:~$
Dear User, Thank you for visitng Kodingwindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.
Dear User, We are grateful for your interest in the Kodingwindow Android app. We intend to soon make it available on the Google Play Store. Currently, Android versions 10 and up require manual apk installations. Would you like to get the app?