
Session 2
Quiz
•
Computers
•
University
•
Practice Problem
•
Medium
Rafael Wampfler
Used 96+ times
FREE Resource
Enhance your content in a minute
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How do you get a new thread to execute its run method?
This automatically happens when you create the thread.
Call .start() on the thread.
Call .run() on the thread.
Call .start() on the thread, then call .run().
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
When is the JVM terminated (i.e., when does a Java programm "end")?
When the main thread finishes executing.
When all non-daemon (user) threads finish executing.
Whenn ALL threads finish executing, including daemon (non-user) threads.
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the problem with the following code?
There is no problem.
The nested class MyThread needs to be static.
The class is defined above the main method.
The nested class MyThread can't be public.
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How are instructions of different threads interleaved?
The thread first created finishes executing, then the second thread, etc.
The threads execute one instruction each, taking turns in order of creation.
Randomly, but no thread executes two instructions in a row if others "wait".
Randomly, there are no guarantees.
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Will this compile and run without a problem?
No, the threads are not joined.
Yes.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Android
Quiz
•
University
10 questions
Unguided transmission media
Quiz
•
University
10 questions
Software Security
Quiz
•
University - Professi...
10 questions
Understanding Email, Contacts and Calendaring
Quiz
•
University
10 questions
ML Course Activity-II
Quiz
•
University
10 questions
NEO LMS Training
Quiz
•
University
10 questions
Tree and Planar Graph
Quiz
•
University
10 questions
CodeMonkey for B.Ed IT
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
