Sail E0 Webinar

MCQs

Total Questions : 50 | Page 1 of 5 pages
Question 1. In java multi-threading, a thread can be created by
  1.    Extending Thread class
  2.    Implementing Runnable interface
  3.    Using both
  4.    None
 Discuss Question
Answer: Option C. -> Using both
Question 2. What is maximum thread priority in Java
  1.    10
  2.    12
  3.    5
  4.    8
 Discuss Question
Answer: Option A. -> 10
Question 3. Which of the following is a valid declaration of a char?
  1.    char ch = '\utea';
  2.    char ca = 'tea';
  3.    char cr = \u0223;
  4.    char cc = '\itea';
 Discuss Question
Answer: Option A. -> char ch = '\utea';
Question 4. Number of threads in below java program ispublic class ThreadExtended extends Thread { public void run() { System
  1.    0
  2.    1
  3.    2
  4.    3
 Discuss Question
Answer: Option C. -> 2
Question 5. What does the following code output?int x = 1;System
  1.    1
  2.    2
  3.    compilation error
  4.    runtime error
 Discuss Question
Answer: Option A. -> 1
Question 6. Find the output of the following snippet
  1.    10
  2.    12
  3.    11
  4.    Compilation Error
 Discuss Question
Answer: Option A. -> 10
Question 7. What will the output of the following code segment be?int a = 1, b = 2;System
  1.    1,2
  2.    2,2
  3.    2,3
  4.    3,3
 Discuss Question
Answer: Option B. -> 2,2
Question 8. This expression executes at the end of each iteration of the for loop
  1.    a. initialization expression
  2.    b. test expression
  3.    c. update expression
  4.    d. statement block
 Discuss Question
Answer: Option C. -> c. update expression
Question 9. Java compiler generates an object file format that is executable on many processors, with the presence of Java runtime system
  1.    Dynamic
  2.    Distributed
  3.    Platform-independent
  4.    Architecture-Neutral
 Discuss Question
Answer: Option D. -> Architecture-Neutral
Question 10. Which method is used to make main thread to wait for all child threads
  1.    Join ()
  2.    Sleep ()
  3.    Wait ()
  4.    Stop ()
 Discuss Question
Answer: Option A. -> Join ()

Latest Videos

Latest Test Papers