Java Thread and I/O Quiz

Java Thread and I/O Quiz

University

25 Qs

quiz-placeholder

Similar activities

TEST FINAL - Lenguaje de Programación I

TEST FINAL - Lenguaje de Programación I

University

20 Qs

ISTE TECHNICAL

ISTE TECHNICAL

University

20 Qs

ASP.NET Core Basics (1)

ASP.NET Core Basics (1)

University

20 Qs

CH 1 - Intro to Computers, Programs, & Java

CH 1 - Intro to Computers, Programs, & Java

University

22 Qs

C Programming Language Quiz

C Programming Language Quiz

University

25 Qs

UTS Teori PJR 2024

UTS Teori PJR 2024

University

20 Qs

Algoritma dan Pemrograman

Algoritma dan Pemrograman

University

20 Qs

Latihan soal Algoritma dan Pemrograman

Latihan soal Algoritma dan Pemrograman

University

25 Qs

Java Thread and I/O Quiz

Java Thread and I/O Quiz

Assessment

Quiz

Computers

University

Medium

Created by

Aswini G

Used 1+ times

FREE Resource

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to create a thread in Java?

Extending the Thread class

Implementing Runnable interface

Both a and b

None of the above

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What method must be overridden when implementing the Runnable interface?

start()

stop()

run()

init()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to start a thread execution?

run()

start()

execute()

initialize()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the synchronized keyword?

To speed up thread execution

To prevent thread execution

To control access to critical sections

To terminate threads

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following are ways to synchronize a block of code?

synchronized method

synchronized statement

synchronized object

Both a and b

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a critical section?

Part of the code where memory is freed

Part of code accessed by multiple threads

A section used only once

None of the above

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is used for inter-thread communication?

notify()

wait()

notifyAll()

All of the above

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?