gs gs128 Java Multithreading - Java Thread Class - Quiz No.1
gs gs128 Java Quiz
This quiz belongs to book/course code gs gs128 Java of gs organization. We have 136 quizzes available related to the book/course Java. This quiz has a total of 7 multiple choice questions (MCQs) to prepare and belongs to topic Java Multithreading. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
Question 1: Which of these method of Thread class is used to find out the priority given to a thread?
get()
ThreadPriority()
getPriority()
getThreadPriority()
Question 2: Which of these method of Thread class is used to Suspend a thread for a period of time?
sleep()
terminate()
suspend()
stop()
Question 3: Which function of pre defined class Thread is used to check weather current thread being checked is still running?
isAlive()
Join()
isRunning()
Alive()
Question 4: What will be the output of the following Java code?
class multithreaded_programing { public static void main(String args[]) { Thread t = Thread.currentThread(); t.setName("New Thread"); System.out.println(t); } }
Thread[5,main]
Thread[New Thread,5]
Thread[main,5,main]
Thread[New Thread,5,main]
Question 5: What is the priority of the thread in output in the following Java program?
class multithreaded_programing { public static void main(String args[]) { Thread t = Thread.currentThread(); t.setName("New Thread"); System.out.println(t.getName()); } }
main
Thread
New Thread
Thread[New Thread,5,main]