Java Basics---Part 15

Table of Contents of Series Articles



1. What are the characteristics of red-black trees?

Following the previous question, the interviewer is likely to ask about red-black trees. Here are several characteristics of red-black trees:

Insert image description here

2. Tell me how you usually handle Java exceptions

try-catch-finally
The try block is responsible for monitoring the code that may cause exceptions.
The catch block is responsible for catching possible exceptions and processing them
. The finally block is responsible for cleaning up various resources and will be executed regardless of whether an exception occurs.
The try block is necessary. Catch and finally There is at least one standard exception handling process

Insert image description here

抛出异常→捕获异常→捕获成功(当 catch 的异常类型与抛出的异常类型匹配时,捕获成功)
→异常被处理,程序继续运行 抛出异常→捕获异常→捕获失败(当 catch 的异常类型与抛

Guess you like

Origin blog.csdn.net/pleaseprintf/article/details/133494698