"Java:the Complete Reference", "Java 8 Programming Reference Official Tutorial (9th Edition)" Reading notes

Source: Internet
Author: User

During the Spring Festival read the next "java:the complete Reference" found this writing in simple, I think a question, the book a lot of content we also know, but why we can not write such a book, so comprehensive, so systematic, so simple and easy to understand. Have to admire Herbert Schildt programming skills, need to mention is Herbert Schildt wrote a lot of Java and C, C + + books, he is the C, C + +, Java and C # programming language Authority, is the ANSI/ISO Organization C language Standardization Committee members.

Herbert Schildt The latest basic Java works are virtually the same, with a somewhat different focus on the content. Although this article is called "Java:the complete Reference" Java 8 Programming Reference Official Tutorial (9th Edition) "Reading notes, but in fact, at the same time reference the following several.

"Java:the complete Reference, ninth Edition" Chinese version "Java 8 Programming Reference Official Tutorial (9th edition)"
"Java:a Beginner's Guide, sixth Edition" Chinese version of "Java 8 Programming Introduction Official Tutorial 6th Edition"
Java programming:a Comprehensive Introduction, "Java 7 programming Introduction classic"

The origins of Java

There are two factors driving the innovation of computer language: the improvement of programming technology and the change of computing environment.


The relationship between Java and C and C + +

Java inherits the syntax of C, and the Java object model is adapted from C + +.

Java is not an enhanced version of C + +, Java is not designed to replace C + +, it is designed to solve specific problems, and C + + is used to solve another different series of problems.


Java Magic: Byte-code

The key to Java's solution to both security and portability issues is that the Java compiler's compilation results are not executable code, but byte-code bytecode.

Bytecode is a series of highly optimized instructions designed to be executed by the Java runtime of the Java Virtual Machine (JVM).

Java virtual machines need to be implemented for each platform, although the Java virtual machines between the platforms are different, but they can all understand the same Java bytecode.

Java programs are also made more secure by the JVM, because each Java program is under the control of the JVM, and some limitations in the Java language enhance security.

It is much slower to interpret a program than to be compiled into executable code, which is not significantly different for Java because bytecode is highly optimized.

Although Java is an interpreted language, it does not technically prevent Java bytecode from being quickly compiled into native code. Sun provided the hotspot technology after the initial version of Java, and the hotspot provided a JIT bytecode compiler.

When the JIT becomes part of the JVM, it can convert bytecode into executable code in real time, because Java performs a variety of checks only at run time, so the entire Java program cannot be compiled into executable code at once, but JIT compiles the code as needed during execution.

Not all bytecode sequences are compiled, only bytecode that can benefit from compilation will be compiled, and the rest of the code is simply explained.


Compiling the program

Javac Example.java

The compiler Javac creates a file (bytecode) named Example.class that contains the program bytecode.

Once the Java source code has been compiled, each individual class is placed in its own output file, and the output file is +.class with the class name extension. Because the source file and the. class file have the same name, it is a good idea to specify the name of the Java source code file as the class name it contains.


Run the program

Java Example

Run the program by the Java interpreter Java, you need to pass the class name example as an argument.


Comments

Supports 3 kinds of annotations:/**/and//and documentation comments, document annotations are used to generate the HTML file for the description program. Start with/** and end with */.


Indent principle

Java itself is a free-form language, but it is recommended to indent, indent one level after each opening parenthesis, and advance one level after each closing parenthesis.


code block

The statement is included in the {} implementation, and once created, the code block becomes a logical unit.

The code block does not add any overhead, {} exists only in the source, and Java does not execute {}.


whitespace characters : spaces, tabs, newline characters. There is at least one white space character between each tag.


identifiers : Identifiers are used to name things, such as classes, variables, and methods. Identifiers can consist of any sequence of characters, such as uppercase and lowercase letters, numbers, underscores, dollar signs, and so on.

Cannot start with a number. Java is case-sensitive.


literal: The value of a constant is created by using a literal that represents a constant.


delimiter : The most commonly used is a semicolon, which is the terminating character of the statement. There is also (), {}. [] and so on.


keywords : 50.



"Java:the Complete Reference", "Java 8 Programming Reference Official Tutorial (9th Edition)" Reading notes

Related Article

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.