Java Learning Note 1

Source: Internet
Author: User

First generation languages: printers-Pure machine language; second-generation languages: compilation; third-generation languages: C, Pascal, FORTRAN oriented process language; C + + process oriented, object oriented; Java cross-platform pure orientation The language of the object, the history of the. NET cross-language platform Java architecture, and the Java system: the characteristics of the Java language: an object-oriented language, a platform-independent language, a provider-run interpretation environment, and a robust language that absorbs the advantages of C + + language, but The parts that affect the robustness of the program are removed (e.g., pointers, memory requests and releases, etc.). Java program running mechanism and running process: Java Virtual machine (Java VM) garbage collection mechanism (garbage collection) core mechanism of the Java Virtual machine:
    • A Java Virtual machine can be understood as a CPU with a byte-code as a machine instruction;
    • For different operating platforms, there are different virtual machines;
    • The Java Virtual machine mechanism masks the difference between the underlying platform and implements "compile once, run everywhere".
Java is an interpreted language, and C + + is a garbage collection of the core mechanisms of a compiled language:
    • Memory space that is no longer used should be recycled-garbage collected;
    • In languages such as C + +, the programmer is responsible for recovering useless memory;
    • The Java language eliminates the responsibility of the programmer to reclaim useless memory space, which provides a system-level thread to track the allocation of storage space and, when the JVM is idle, checks and frees those memory spaces that can be freed.
    • Garbage collection runs automatically during Java programs, and programmers cannot control and intervene accurately;
Java Application Preliminary:
    • The Java source file has a "java" extension. The basic component of the source file is the class, such as the HelloWorld class in this example.
    • There can be at most one public class in a source file. The number of other classes is unlimited, and if the source file contains a public class, it must be named by that class name. Naming should be consistent with the name of the public class
    • The execution portal for Java applications is the main () method. It has a fixed writing format:
      public static void Main (String args[]) {...}
    • The Java language is strictly case sensitive;
    • The Java method consists of a single sentence, with each statement ending with a semicolon;
    • There are three ways to annotate the Java language:
Summary of the first program:
      • Build the programmer's own environment;
      • Use copy;
      • Master the concept of path and classpath;
      • familiar with common mistakes;
      • Familiar with Java program simple rules;
      • Familiar with the compiling and running of Java program;

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.