Java Basics Section
- The difference between constants and variablesis that the final keyword modifier is constant, and if there are static keyword modifiers, it is often called a compile-time constant. Variable, the runtime can modify its reference.
- Java is basically similar to what
1 Byte = 8 bits (in detail, this is actually related to the number of bits in the machine.) )
- String/stringbuffer/stringbuilder differences: String constants, string lengths immutable, StringBuffer (JDK 1.0) security (does not mean that threads are safe) can be repeated operation of string variables Stringbulider (JDK 1.5) is unsafe and can be reused as a string variable because it is unsafe, so it is more efficient than StringBuilder.
- Collection (holding object, container): HashMap allows NULL to be used as a entry key/value, and Hashtable not allowed. Hashtable, Vector, Stack belongs to obsolete classes are not recommended for use
Static and fianl and finally:
The blank final can be defined, but it must be initialized inside the constructor or at the definition.
Static is initialized at load time, and non-static is initialized after loading.
- Continue updating ...
North Drift Interview Experience (one (two) years work experience)--Java Foundation section