Session 2

Session 2

University

5 Qs

quiz-placeholder

Similar activities

Social Media Communication Quiz

Social Media Communication Quiz

University

10 Qs

Introduction to HTML

Introduction to HTML

University

10 Qs

Week 1 Recap

Week 1 Recap

University

10 Qs

Fixed Length Subnet Mask (FLSM)

Fixed Length Subnet Mask (FLSM)

University

10 Qs

Exploring Microservices Arch

Exploring Microservices Arch

University

10 Qs

Gameplay-Quiz 1 & Quiz 2

Gameplay-Quiz 1 & Quiz 2

University

10 Qs

S3 Computing Security Quiz

S3 Computing Security Quiz

KG - University

10 Qs

MPB Week 6

MPB Week 6

University

10 Qs

Session 2

Session 2

Assessment

Quiz

Computers

University

Medium

Created by

Rafael Wampfler

Used 96+ times

FREE Resource

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.