First, write and run the Java program steps:
1. Writing Java source code
Java source code files are already Java as extensions
Java code format:
Class Name {
Main Method}
2, compile, compile the character file into a byte file
Open the directory where the Java files are located in DOS
Compile: Javac file name (with extension) if no other information is prompted, and there is a. class extension file in the current folder, the compilation succeeds.
3. Running Java byte file
Command: Java file name (does not include extension because all Java bytecode files end with. Class)
4. Comments
Single-line Comment://comment Content
Multi-line Note 1,
/*
Multiline comment: not compiled into class file
*/
/**
* Multiple lines of comments are compiled into the class file
*/
5. Operators
Statement
Constant
Variable
Data type variable name = value;
int score = 89;
Second, heap, stack, method area
Heap: Instantiating objects, data storage
Stack: How to run
Method zones: Load classes, assign class member variables, and portals of static methods. Contains a constant pool
three major elements of Java: Inheritance, encapsulation, polymorphism
1.
java--Summary