"Java Core Technology"--book note ①-preheating

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.