First, to talk about final, finally, finalize the difference.
Final is used to declare properties, methods, and classes, respectively, that the property is immutable, that the method is not overridden, and that the class is not inheritable. Finally is part of the exception-handling statement structure, which indicates that it is always executed. Finalize is a method of the object class that, when executed by the garbage collector, calls this method of the reclaimed object, and can override this method to provide garbage collection of other resource recycles, such as closing the file.
Second, Anonymous Inner class (anonymous inner Class) can extends (inherit) other classes, can implements (implement) interface (interface)?
You can inherit other classes or complete other interfaces, which are common in swing programming.
Thirdly, the Static Nested class and the Inner class are different, the more said the better (some of the questions are very general).
The static Nested class is an inner class declared static (static), which can be instantiated without relying on an external class instance. The usual inner classes need to be instantiated after the external class is instanced.
The difference between,& and &&.
& is a bitwise operator that represents the bitwise AND Operation,&& is a logical operator that represents the logical and (and).
The difference between HashMap and Hashtable.
HashMap is a lightweight implementation of Hashtable (non-thread-safe implementation), they all complete the map interface, the main difference is that the HASHMAP allows null (NULL) key value (key), because of non-thread security, the efficiency may be higher than Hashtable.
The difference between the Collection and the collections.
Collection is the ancestor interface of the collection class, and the inheritance and his interface are mainly set and List.collections is a helper class for the collection class, he provides a series of static methods to implement the search, sort, thread-safe operation of various sets.
VII, when to use the Assert.
1.4 New keyword (syntax) for testing the status of a Boolean expression that can be used to debug a program. Use the method assert, which indicates that if the expression is true (true), the following statement executes, otherwise throws assertionerror. Another way to use the Assert < Boolean expression is:, if the expression is true, the subsequent expression is ignored, otherwise the value of the subsequent expression is used for the Assertionerror build parameter. Note that the compile time to increase the-source 1.4 parameters, or error. ] to increase the –ea parameter at run time, otherwise the Assert row is ignored
What's the GC? Why do you have a GC?
GC is the meaning of garbage collection (Gabage Collection), memory processing is where programmers are prone to problems, forgotten or wrong memory recycling can cause program or system instability or even crash, Java provides the GC function can Automatic monitoring of whether an object exceeds the scope to achieve the purpose of automatically reclaiming memory, the Java language does not provide a way to release the allocated memory display operation.
The ninth, string s = new string ("XYZ"), and the creation of several string Object?
Two
Tenth, Math.Round (11.5) how much? Math.Round (-11.5) how much?
Math.Round (11.5) ==12math.round ( -11.5) ==-11round method returns the longest integer closest to the parameter, and the parameter adds 1/2 to its floor.
11th, short S1 = 1; S1 = s1 + 1; what's wrong? Short S1 = 1; S1 + = 1; what's wrong?
Short S1 = 1; S1 = s1 + 1; (S1+1 operation result is int type, need cast type) short S1 = 1; S1 + = 1; (can be compiled correctly)
12th, what is the difference between sleep () and wait ()?
Sleep is a threading class (thread) method that causes this thread to pause execution for a specified time, giving the execution opportunity to other threads, but the monitoring state remains and is automatically restored when it is finished. Calling sleep does not release the object lock. Wait is a method of the object class that calls the wait method on this object to cause this thread to discard the object lock, enter the waiting lock pool waiting for this object, and only after the Notify method (or Notifyall) is issued for this object the thread enters the object lock pool ready to get the object lock into the running state.
13th, does Java have a goto?
There is not a 13 question, if which interview asked this question, I advise you still do not enter this company.
Java Programmer interview must know 32 points of knowledge