adplus-dvertising

Welcome to the Multithreading MCQs Page

Dive deep into the fascinating world of Multithreading with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Multithreading, a crucial aspect of Java Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Multithreading, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within Java Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Multithreading. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Java Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Multithreading. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Multithreading MCQs | Page 2 of 10

Q11.
What is the output of this program?
    class newthread implements Runnable
    {
 Thread t;
 newthread()
        {
     t = new Thread(this,"My Thread");
     t.start();
 }
 public void run()
        {
     System.out.println(t);
 }
    }
    class multithreaded_programing
    {
        public static void main(String args[])
        {
            new newthread();        
        }
    }
Discuss
Answer: (b).Thread[My Thread,5,main].
Q12.
Which of these method of Thread class is used to find out the priority given to a thread?
Discuss
Answer: (c).getPriority()
Q13.
Which function of pre defined class Thread is used to check weather current thread being checked is still running?
Discuss
Answer: (a).isAlive()
Q14.
What is the output of this program?
    class multithreaded_programing
    {
        public static void main(String args[])
        {
            Thread t = Thread.currentThread();
            t.setName("New Thread");
            System.out.println(t);        
        }
    }
Discuss
Answer: (d).Thread[New Thread,5,main].
Q15.
What is the priority of the thread in output of this program?
    class multithreaded_programing
    {
        public static void main(String args[])
        {
            Thread t = Thread.currentThread();
            t.setName("New Thread");
            System.out.println(t.getName());        
        }
    }
Discuss
Answer: (c).New Thread
Q16.
Which of these are types of multitasking?
Discuss
Answer: (c).Process and Thread based
Q17.
Thread priority in Java is?
Discuss
Answer: (a).Integer
Discuss
Answer: (d).It is dependent on the operating system
Q19.
What is the output of this program?
    class multithreaded_programing
    {
        public static void main(String args[])
        {
            Thread t = Thread.currentThread();
            System.out.println(t);        
        }
    }
Discuss
Answer: (d).Thread[main,5,main].
Q20.
What is the priority of the thread in output of this program?
    class multithreaded_programing 
    {
        public static void main(String args[])
        {
            Thread t = Thread.currentThread();
            System.out.println(t);        
        }
    }

a.

4

b.

5

c.

0

d.

1

Discuss
Answer: (b).5
Page 2 of 10

Suggested Topics

Are you eager to expand your knowledge beyond Java Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!