首页 > 代码库 > Java面试题(1)- 高级特性

Java面试题(1)- 高级特性

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面试题(1)- 高级特性