I am a small slag, engaged in Java development time is not long, the following mentioned questions only represent personal opinion, what is unreasonable place also hope that the great God said, thank you
Okay, here's the job:
Interview as the only standard of enterprise selection, then each enterprise has its own choice of standards, but technology (Java) in this respect or a change in the case, the basis for all interviewers like to take to examine the interviewer's initial cautious choice of the only standard,
So the basis of all aspects must be solid, solid
Here are some of the basic questions that companies often ask: you can learn from them. (Original, all my personal understanding, non-web copy)
1. Overload and override distinguish whether the overloaded method can change the type of the return value.
Overload (Overload): occurs in the same class, which means that there can be multiple methods with the same name in the same class, but the argument lists for these methods are different (that is, the number of arguments and the type of argument).
Override (Overrides, overrides): Occurs between a subclass and a parent class, indicating that a method in a subclass can be exactly the same as the name and parameters of a method in the parent class. When the method is invoked by the instance object created by the subclass, the method defined in the subclass is invoked, and the method defined in the parent class is overridden (an embodiment of object-oriented polymorphism, often the first few multiple-choice questions or simple questions in the written exam).
The most familiar overlay is the implementation of the interface method, which is generally only declared in the interface, implementing all the methods declared in the interface, and may overwrite the method in the parent class in the subclass in the inheritance.
You should be aware that subclasses override methods of the parent class:
1. Subclasses can throw only fewer exceptions than the parent class, or a child exception that throws a parent class exception. (Reason: Subclasses can resolve some of the problems of the parent class and cannot have more problems than the parent class).
2. A subclass method can have access only larger than the parent class, not smaller, such as the parent class is private, the subclass does not have coverage restrictions, and the subclass adds a new method.
Whether the overloaded method can change the type of the return value.
1. If the parameter list of several overloaded methods is different, the type of the return value can be different.
2. If the parameter list of the two methods is exactly the same, it is not possible. (This can be proved by contradiction)
(because sometimes when we call a method, we can also not define the return result variable, that is, we don't have to care about returning results.
For example, when we call the Map.Remove (key) method, although the remove has a return value, we usually do not define a variable that receives the return result, assuming that the class has two names and argument lists that are exactly the same, except for the return value. Java cannot determine exactly which method to invoke because it cannot be judged by the return result type. )
A few things to note about overloading:
1. When using overloads, you can only pass different parameter styles (different parameter types, number, order, and the same parameter type must not be the same).
2. You cannot overload an exception that is thrown by an access right return type.
3. The exception type and number of methods do not affect overloading.
4. For inheritance, if a method has access in the parent class that is private, the subclass cannot overload it, and if defined, it simply defines a new method that does not achieve the overload effect.
2.String and StringBuffer difference
String and StringBuffer can manipulate strings, string has the Equals method, StringBuffer not.
String provides strings that cannot be changed numerically, and the strings provided by StringBuffer are variable and can be used to dynamically construct character data.
3.HashMap and Hashtable difference
4.final,finally,finalize Difference
5.Java how to do exception handling, keywords: throw,throws,try catch finally respectively represents the declaration meaning. Can I throw an exception in a try block.
What is the difference between 6.error and exception?
7.forward and redirect difference.
8.Collection and collections difference.
9.int and integer differences.
10.ArrayList and LinkedList difference.
11.Hibernate and Ibatis difference.
12.abstract class differs from interface.
13.