Chapter I. , First Knowledge Java
1. 1.Java is a programming language, a development environment, an application environment, a deployment environment.
2.Java Features: Simple, object-oriented, distributed, secure, stable, interpretive, multi-line, dynamic language.
The 3.Java technology platform has three types of
(1) Javase (Java Platform Standard Edition): It is a version developed by Sun for desktop development and low-end business computing, designed for laptops and PCs.
2) Java EE (Java Platform Enterprise Edition): An architecture that leverages the JAVA2 platform to simplify the development of enterprise solutions, deploy and manage related complex issues, designed for enterprise-class, server-side high-end applications.
(3) Javame (micro version of Java platform): It is a mobile terminal for limited memory, designed for consumer products.
4. Steps to develop Java programs
(1). Writing the source program
Create a source file. Java source files are Java code files, written in the Java language. Java source
The file is a plain text file with the extension ". Java". You can use any text editor to create and edit
The source file.
(2). Compiling
Compiles a source file into a. class file. Using the compiler tool Javac.exe with the JDK, it
Reads the source file and compiles its text into an instruction that the Java virtual function understands, saved in the suffix. class
End of the file. The instructions contained in the class file are known as bytecode (bytecodes)
, it is a platform-independent binary file that is executed by the interpreter Java.exe to explain the cost of the machine code,
Side interpretation side Execution.
(3). Run
Run the program. Use the Java Interpreter (Java.exe) to interpret bytecode for executing Java applications
File (. class file) to run Java applications by using a Java virtual machine.
5. The code of a complete Java file is divided into several parts, each of which plays a role
Package Current class Location
Import the package or class that is required for the current class to run
public class class Name {
attribute definition;
Method definition:
Construction method definition;
public static void Main (String args []) exception {Program entry
Statement
}
6 Simple Java Architecture
Notes for 7.java Programs
(1). Single-line Comment://
(2) Multi-line Comment:/*
*
*/
(3) Document Comment:/** */
8.java Coding Specification
(1). The program is written according to the Java coding specification. A program does not press
Coding specifications may also be operational, but programs not written in accordance with coding specifications
is not a good program, this program is not easy to view and maintain the program.
(2). The coding specification includes a lot of content, such as code writing rules, naming rules, code notes
A number of content. The code must have indentation, the indentation can use the TAB key, or four spaces.
Because 4 spaces default in Eclipse as a tab indent unit.
(3) No more than 80 characters per line of code, because many authoring tools do not have a good explanation for the content of more than 80 characters.
When the. Code does not fit in one line, it should be wrapped. But line breaks do not wrap, but are wrapped in levels and aligned at the same level.
Chapter I study Summary