review ni sir josh

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/49

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:18 PM on 6/4/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

50 Terms

1
New cards

A developer wants two independent tasks to execute simultaneously while sharing the same memory space. Which approach is most appropriate?

Create two threads within the same process

2
New cards

A Java application performs file downloading and user interface rendering. The UI becomes unresponsive during downloads. What is the BEST solution?

Move downloading logic to a separate thread

3
New cards

What is the PRIMARY advantage of implementing Runnable instead of extending Thread?

Supports multiple inheritance of behavior

4
New cards

A programmer directly invokes run() instead of start(). What will most likely happen?

The method executes in the current thread

5
New cards

A banking application processes deposits and withdrawals simultaneously. Which concept makes this possible?

Concurrency

6
New cards

A context switch occurs when:

The CPU stores and restores thread states

7
New cards

Which scenario demonstrates true multithreading?

Multiple tasks sharing execution time

8
New cards

Why might a developer choose join()?

To wait for another thread to finish

9
New cards

Suppose Thread A calls join() on Thread B. What happens?

Thread A waits for B

10
New cards

A programmer wants a thread to pause for five seconds. Which method should be used?

sleep()

11
New cards

Why is multithreading beneficial in a web server?

Allows handling multiple client requests concurrently

12
New cards

A thread's priority is set to 10. What can be concluded?

It has greater chance of CPU access

13
New cards

Which statement about thread priority is TRUE?

Priority affects scheduling decisions but not guarantees

14
New cards

A thread's isAlive() method returns false. Which conclusion is MOST reasonable?

The thread has terminated

15
New cards

Why is the main thread considered special?

It starts execution of the application

16
New cards

Which design is more scalable for creating hundreds of worker tasks?

Implementing Runnable tasks

17
New cards

A thread is waiting for a network response. What benefit does multithreading provide?

Allows other threads to continue working

18
New cards

A developer observes unpredictable output ordering among threads. Why?

Thread scheduling is controlled by the OS scheduler

19
New cards

What is the biggest risk of assuming thread execution order?

Unreliable program behavior

20
New cards

A thread is sleeping. Which statement is correct?

It temporarily stops execution

21
New cards

Which method serves as the entry point of a thread?

run()

22
New cards

What happens if start() is never called?

The thread never begins execution as a separate thread

23
New cards

A thread scheduler primarily determines:

CPU allocation among threads

24
New cards

Which situation best illustrates concurrency?

Downloading a file while updating a progress bar

25
New cards

Why is Runnable often preferred in enterprise applications?

It allows separation of task and thread management

26
New cards

If Thread A sleeps for 10 seconds, what happens to other threads?

They may continue executing

27
New cards

A process differs from a thread because a process:

Is a collection of associated threads

28
New cards

Which scenario requires join() most?

Generating a report after data processing threads finish

29
New cards

A programmer creates three threads and expects exact output order. Why is this problematic?

Scheduling is nondeterministic

30
New cards

What is the default thread priority in Java?

5

31
New cards

Which priority value is invalid?

11

32
New cards

A system creates too many threads unnecessarily. What is a likely consequence?

Increased overhead and context switching

33
New cards

What is the purpose of Thread.currentThread()?

Returns the currently executing thread object

34
New cards

Which statement best explains shared memory?

Threads within a process can access common data

35
New cards

Which feature makes multithreading suitable for games?

Supports simultaneous input, rendering, and audio processing

36
New cards

What is the effect of calling join() after start()?

Waits until the specified thread finishes

37
New cards

Which scenario most likely benefits from sleep()?

Polling a resource periodically

38
New cards

What is the main purpose of setName()?

Simplify debugging and identification

39
New cards

A developer notices that high-priority threads do not always execute first. Why?

Priority is only a scheduling hint

40
New cards

Which method helps determine whether a thread has completed execution?

isAlive()

41
New cards

Why might extending Thread be less flexible?

Java allows only one class inheritance

42
New cards

A thread completes execution. What is its state regarding isAlive()?

false

43
New cards

Which design best separates business logic from thread execution?

Runnable implementation

44
New cards

What is the likely result if a program depends on thread execution order without synchronization?

Inconsistent outcomes

45
New cards

Which application is LEAST likely to benefit from multithreading?

Batch calculator performing one simple operation once

46
New cards

What is the most accurate description of concurrency?

Simultaneous management of multiple tasks

47
New cards

Why is context switching necessary?

To allow multiple threads to share CPU time

48
New cards

A developer wants to ensure that data processing completes before report generation starts. Which method is most suitable?

join()

49
New cards

Which statement best reflects real-world thread scheduling?

Scheduling decisions depend on the OS and JVM implementation

50
New cards

A software architect is designing a system that must remain responsive while performing long-running tasks. Which principle should guide the design?

Divide tasks into concurrent threads when appropriate