java--Horse Soldier Tutorial Study notes

Source: Internet
Author: User
Tags naming convention

Introduction to Java

1. Java Cross-platform: Compile once, execute everywhere. --java the existence of a virtual machine.

2. Java is an interpreted language

    • Compiled by: C + +, directly compiled into the format of the operating system executable file (such as the Windows executable file is an. exe file), without a second
    • Explanatory: Java,java is compiled into the format of its own executable file. class, and the JVM then interprets the. class file one line at a time, explaining the executable format for each platform. Executed in one row and one row in explanation.

3. Executable binary file in bin directory

4. Path:windows the path to search when executing commands

Classpath:java the path of the class to be found at compile and run time

5. Each of the. java files is compiled with each class generating a corresponding. class file.

6. There can be only one public class in a. java file, and the file name of the. java file must be consistent with the class name of the public class.

The program entry for the 7.java program is the main () method, fixed format:

 Public Static void Main (string[] args) {...}//args name variable

8.java strictly case-sensitive

9. There are three ways of commenting:

// single-line comment /* Multiline Comment multi-line Comment */ /** * Multiple lines of comments, and can be parsed by the DOC tool * Multi-line comments, and can be parsed by the Doc tool * */
Java Basic syntax

1. Java represents a naming convention:

    • Identifiers consist of letters, numbers, underscores, or dollar characters
    • Identifiers are preceded by letters, underscores, or dollar characters $
    • Identifier case sensitive, unlimited length
    • Identifiers cannot have the same name as a Java language keyword
    • The selection of identifiers should pay attention to "see the meaning of the name"

2. Keywords

3. Constants

4. Variables

    • Declaration--assignment--using

5.java program Running Process

The above process:

    • Files that exist on your hard disk:. exe files,. class files, and so on
    • Load the files on the hard disk into memory
    • Executes in memory from the Main method
    • Memory is divided into 4 regions during program execution:
      • Code Segment: Codes section for storing load incoming code
      • Data segment: Storing static variables and string constants
      • Heap: Dynamically request memory, store new things
      • Stack: Store local Variables

6.java Variable Classification

    • Local variables: Method parameters and methods body-defined variables
    • Member variables: Inside the class body but outside the method body

Scope: The {} that the variable is located in cannot be used.

java--Horse Soldier Tutorial Study notes

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.