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面试题- 高级特性的主要内容,如果未能解决你的问题,请参考以下文章