首页题目详情

当一个线程被中断时,它可能会抛出什么异常?

题目配图
A.NullPointerException
B.ArrayIndexOutOfBoundsException
C.InterruptedException
D.IOException

优质解答

答案

C

解析

当线程被中断时,如果它正在执行 sleep()、wait() 或 join() 等阻塞操作,会抛出 InterruptedException。这是线程中断机制的典型表现。

查看答案和解析

支付 ¥0.1 即可查看此题答案和详细解析

低至 ¥0.1 起

面向对象程序设计单选题中等AI生成