Skip to content

Commit b9638b8

Browse files
authored
Update interviewQuestions.md
1 parent fae072d commit b9638b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

interviewQuestions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Creating thread is expensive in terms of time and resource. If you create thread
127127
There is a method called `Thread.holdsLock(Object obj)` on `java.lang.Thread`, it returns true if and only if the current thread holds the monitor lock on the specified object.
128128

129129
#### 21. What happens if you submit a task when the queue of the thread pool is already filled?
130-
ThreadPoolExecutor's `submit()` method throws RejectedExecutionException if the task cannot be scheduled for execution.
130+
ThreadPoolExecutor's `submit()` method throws `RejectedExecutionException` if the task cannot be scheduled for execution.
131131

132132
#### 22. What is the difference between the submit() and execute() method thread pool in Java?
133133
A main difference between the `submit()` and `execute()` method is that `ExecuterService.submit()` can return result of computation because it has a return type of Future, but `execute()` method cannot return anything because it's return type is void.

0 commit comments

Comments
 (0)