β˜‘ MCQ PRACTICE

Java Programming Part 3

Practice objective questions for quick revision and examination preparation. Try answering each question before revealing the answer.

πŸ“š Java Programming
πŸ“– Part 3
🎯 MCQs

Java Programming - Part-3

1
What is multithreaded programming?
AIt’s a process in which two different processes run simultaneously
BIt’s a process in which two or more parts of same process run simultaneously
CIt’s a process in which many different process are able to access same information
DIt’s a process in which a single process can access information from many sources
Correct Answer It’s a process in which two or more parts of same process run simultaneously
2
Which of these are types of multitasking?
AProcess based
BThread based
CProcess and Thread based
DNone of the mentioned
Correct Answer Process and Thread based
3
Thread priority in Java is?
AInteger
BFloat
Cdouble
Dlong
Correct Answer Integer
4
What will happen if two thread of the same priority are called to be processed simultaneously?
AAnyone will be executed first lexographically
BBoth of them will be executed simultaneously
CNone of them will be executed
DIt is dependent on the operating system
Correct Answer It is dependent on the operating system
5
Which of these statements is incorrect?
ABy multithreading CPU idle time is minimized, and we can take maximum use of it
BBy multitasking CPU idle time is minimized, and we can take maximum use of it
CTwo thread in Java can have the same priority
DA thread can exist only in two states, running and blocked
Correct Answer A thread can exist only in two states, running and blocked
6
Which of these keywords are used to implement synchronization?
Asynchronize
Bsyn
Csynch
Dsynchronized
Correct Answer synchronized
7
Which of this method is used to avoid polling in Java?
Await()
Bnotify()
CnotifyAll()
Dall of the mentioned
Correct Answer all of the mentioned
8
Which of these method is used to tell the calling thread to give up a monitor and go to sleep until some other thread enters the same monitor?
Await()
Bnotify()
CnotifyAll()
Dsleep()
Correct Answer wait()
9
Which of these method wakes up the first thread that called wait()?
Awake()
Bnotify()
Cstart()
DnotifyAll()
Correct Answer notify()
10
Which of these method wakes up all the threads?
AwakeAll()
Bnotify()
Cstart()
DnotifyAll()
Correct Answer notifyAll()
11
What is synchronization in reference to a thread?
AIt’s a process of handling situations when two or more threads need access to a shared resource
BIt’s a process by which many thread are able to access same shared resource simultaneously
CIt’s a process by which a method is able to access many different threads simultaneously
DIt’s a method that allow too many threads to access any information the require
Correct Answer It’s a process of handling situations when two or more threads need access to a shared resource
12
Which of these keywords are used to implement synchronization?
Asynchronize
Bsyn
Csynch
Dsynchronized
Correct Answer synchronized
13
Which of these method is used to tell the calling thread to give up a monitor and go to sleep until some other thread enters the same monitor?
Await()
Bnotify()
CnotifyAll()
Dsleep()
Correct Answer wait()
← Back to All MCQs