Java Learning Note 1

Source: Internet
Author: User

1.1 Features of Java

1.1.1 Object-oriented:

· Java is a pure object-oriented language compared to C + +

C + +, in order to backward-compatible with c. Reserved a lot of C features, and C, known as the process-oriented language, which makes C + + become a "hybrid." In the Java syntax, the features reserved for C in C + + are canceled, such as header file, pointer algorithm, structure, unit, etc.

1.1.2 Portability (Platform agnostic):

· Generating intermediate bytecode directives unlike other programming languages, Java does not generate an executable file (. exe file), but rather produces an intermediate bytecode file (. class file). Any operating system, as long as the Java Virtual Machine (JVM) is installed, can interpret and execute this intermediate bytecode file. This is the mechanism by which Java implements portability.

· Raw data type storage method fixed, avoiding porting problems

The size of the original data type of Java is fixed. For example, on any machine, the integer is 32 bits, while the C + + integer is dependent on the target machine, for 16-bit processors (such as 8086), integers in two bytes; in 32-bit processors such as sun SPARC, integers are represented in 4 bytes. On Intel Pentium processors, integer types are determined by the specific operating system: for DOS and Win32, integers are 2 bytes, and for Windows 9x, NT, and 2000, integers are 4 bytes. Of course, performance is bound to drop after making the integer type platform irrelevant, but for Java, the cost is worth it. Java string, which is saved in the standard Unicode format. It can be said that without this feature, Java portability is unlikely to happen. 1.1.3 Simple · Java is syntactically similar to C + +

Java syntax is close to C + +, and programmers with C or C + + programming experience can easily learn Java syntax;

· Removed some of the complex and inefficient features of C + +, such as: using interface technology instead of C + + multiple inheritance. In C + +, a class is allowed to have multiple superclass, which is called "Multiple inheritance", and multiple inheritance makes the compiler very complex and inefficient; Java classes allow only one superclass, while interface (INTERFACE) technology implements multiple inheritance functions similar to C + +

Other features that are canceled include: virtual base class, operator overload, etc.

· Java's BASIC interpreter and class support module is about 40K

Even if you join the basic standard library and support the threading module, it is only about 220K. Significantly smaller compared to GUI (graphical user interface)

Java Learning Note 1

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.