在idea里面鼠标放在红线上显示

Unhadnled exception:java.lang.InterruptedException

则需要抛出异常或者try-catch,如图

idea抛出异常的快捷键

快捷方式  双击选中红色提示   按 Alt+Enter     

Add exception to method signature 为抛出异常

Surround  with  try/catch                 为   try-catch

idea抛出异常的快捷键

 

 

相关文章:

  • 2022-12-23
  • 2021-06-26
  • 2021-10-06
  • 2021-11-19
  • 2021-11-22
  • 2021-05-05
  • 2021-07-11
猜你喜欢
  • 2021-04-03
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2021-11-19
相关资源
相似解决方案