Introduction
Before using the online example of some of their own Java technology and the wheel of the fast "rotten" made some small applications, but after all, did not seriously understand and cognitive Java, it is intended to spend about one months time to savor ... Start from the beginning and go deeper!!
Definition of Java
Java is not just a language, he is a complete platform , with a huge library of reusable code and an execution environment that provides services such as security, cross-operating system portability, and automated garbage collection. .
Applet
Applets Refer to Java programs that run on Web pages. The earliest expression is a program that runs in a Java-enabled browser. This is now generally referred to as a server program written by Java.
JDK and JRE
To put it simply, the JDK is for developers, because it includes compilers. The JRE is used by the user and contains only a single runtime environment.
Set the execution path (path)
Path is the path to the Java executable file that the operating system looks for by default.
Type 1 in Java. Representation of a constant (final)
Final Double per_inch=2.54;
2. strictfp-represents an accurate floating-point calculation where the intermediate process does not truncate
// The following method is calculated using the exact floating point number Private double Calculate (double double double z) { return x * Y/ z; }
3. Use String.Equals () to determine if the strings are equal, not "= =" 4. "" represents an empty string, and Null indicates that the string variable is not associated with any string object
5. StringBuilder vs StringBuffer
Their APIs are the same, StringBuffer can build or manipulate strings in multi-threaded mode.
6. Standard input and formatted output
Stdin:
New Scanner (system.in); SYSTEM.OUT.PRINTLN ("input something here ..."); In.nextline ();
Formatted output: System.out.printf ()
7. For Each loop
for (variable:collection) { ... }
"Java Core Technology"--book note ①-preheating