1, please use regular expression to match the QQ number (assuming QQ number is 5-10-bit);
Answer: ^ \d{5,10}$
2, String, StringBuffer StringBuilder difference.
Answer: The length of the string is immutable, the length of the StringBuffer is variable, if you are working on the contents of the string frequently, especially when the content is to be modified, then use StringBuffer, if the last string is required, Then use the ToString () method of StringBuffer; thread-safe; StringBuilder is starting with JDK 5, which complements the equivalence class used by a single thread for StringBuffer class; StringBuilder classes should usually be preferred , because it supports all the same operations, but because it does not perform synchronization, it is faster.
3, please write out 5 kinds of common to the runtime exception.
Answer:
NullPointerException: This error occurs when you manipulate a null reference.
NumberFormatException: This exception occurs when there is a problem with the data format conversion.
ClassCastException: This exception occurs when coercion type conversion types do not match.
ArrayIndexOutOfBoundsException: Array subscript is out of bounds when this exception occurs when using an array subscript that does not exist.
ArithmeticException: This exception occurs when math runs incorrectly
Java Face question 09