Java面试题- 高级特性

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Java面试题- 高级特性相关的知识,希望对你有一定的参考价值。

1. The diffrence between java.lang.StringBuffer and java.lang.StringBuilder?

java.lang.StringBuffer: thread-safe, synchronized and not so faster.

java.lang.StringBuilder: faster, performs no synchronization.

2. How to handle uncaught Exception for a thread?

@FunctionalInterface
public static interface Thread.UncaughtExceptionHandler

3. The difference between [checked exceptions] and [unchecked exceptions]?

The class Exception and any subclasses that are not also subclasses of RuntimeException are checked exceptions. Checked exceptions need to be declared in a method or constructor‘s throws clause if they can be thrown by the execution of the method or constructor and propagate outside the method or constructor boundary.

以上是关于Java面试题- 高级特性的主要内容,如果未能解决你的问题,请参考以下文章

经验总结:Java高级工程师面试题-字节跳动,成功跳槽阿里!

PHP中高级面试题 – 第三天

java面试题——java高级

大厂Java高级面试题汇总解答

高级各大公司Java后端开发面试题总结-下

2021阿里Java高级面试题总结,GitHub已标星16k