Session 3

Session 3

University

8 Qs

quiz-placeholder

Similar activities

java quiz on Encapsulation and Abstraction

java quiz on Encapsulation and Abstraction

University

10 Qs

Digital Technology Office 365 - 29May2020

Digital Technology Office 365 - 29May2020

University - Professional Development

13 Qs

Quiz3_DivideConquer_GreedyApproach

Quiz3_DivideConquer_GreedyApproach

University

10 Qs

OOP intro quizz

OOP intro quizz

University

10 Qs

Python with DataScience

Python with DataScience

7th Grade - University

10 Qs

Pemkom 8

Pemkom 8

University

10 Qs

UAS Sistem Operasi Open Source

UAS Sistem Operasi Open Source

University

10 Qs

GDPR

GDPR

University

10 Qs

Session 3

Session 3

Assessment

Quiz

Computers

University

Easy

Created by

Rafael Wampfler

Used 102+ times

FREE Resource

AI

Enhance your content in a minute

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

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which object is synchronized?

Nothing

this (the object the method belongs to)

We can't tell from just this

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When a thread leaves a synchronized block, other threads that want to enter it automatically try to do so.

True

False

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In which state is a thread after we call .start()?

NEW

RUNNABLE

NOT RUNNABLE

TERMINATED

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When does a thread leave the RUNNABLE state without entering the terminated state?

After .run() finished executing

When it becomes blocked or waiting

After creating it, before we call .start()

When we call .notRunnable()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If a thread enters a NOT RUNNABLE state because it .waits() on an object, how does it go back to the RUNNABLE state?

It keeps checking if the object is no longer locked until it succeeds

If .notify() or .notifyAll() is called

After a certain amount of time it automatically happens

If we call .start() on it

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Can a thread call synchronized() on the same object multiple times?

Yes

No, this causes an exception

No, this will make the program run forever

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can a thread become the owner of an object's monitor (lock)?

By executing a method/block synchronized on the object

By calling .wait() on the object

Threads can't own monitors

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

To call .wait() or .notify() on an object, a thread has to own the monitor of that object.

True

False