Session 2

Session 2

University

5 Qs

quiz-placeholder

Similar activities

Python Week 1 & 2

Python Week 1 & 2

University

10 Qs

Quiz 1: The background and history of IoT

Quiz 1: The background and history of IoT

University

10 Qs

ADVERTISEMENT PRODUCTION & AGENCY (W10 - W12)

ADVERTISEMENT PRODUCTION & AGENCY (W10 - W12)

University

10 Qs

Session 20

Session 20

KG - University

10 Qs

Hands-on Modul 3

Hands-on Modul 3

University

10 Qs

Visual Basic 2010

Visual Basic 2010

8th Grade - University

10 Qs

CS100||MsWord

CS100||MsWord

University

10 Qs

Website Usability and UX

Website Usability and UX

University

10 Qs

Session 2

Session 2

Assessment

Quiz

Computers

University

Practice Problem

Medium

Created by

Rafael Wampfler

Used 96+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Media Image

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

Media Image

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?