Chapter I. Notes
What is a computer program: a series of ordered sets of instructions for the production of certain functions
Java technologies include:
Java SE: Standard Edition
Java EE: Enterprise Edition
Java ME: Mobile Version
Developing Java program steps: 1. Writing 2. Compiling 3. Running
1. Writing:
A. Curly braces appear in pairs
The word after B.class is the same as the file name. (!! Include case)
C.java Strictly case-sensitive
2. Compiling:
Command: Javac file name. java
Produce the result: A. class suffix file (this file, can not read, garbled)
(Note!!!) If the code is modified, it needs to be recompiled and run)
3. Run:
Command: Java file name (no suffix!!) )
Produce results: Output information
SOURCE program: To. Java End
Compiled file: End With. class
Code parsing:
The outer framework of the public class demo{//program (class framework)
public static void Main (string[] args) {//program's inner frame (Main method)
System.out.println ("java!! Hello! "); /printout (add line wrapping at the end)
System.out.print ("hello!"); /No line break after printing
}
}
Escape character:
\ n wrap \ \ tab (equivalent to a tab in the Keyboard tab equivalent to 8 spaces)
Comments:
Single-line Comment://ctrl+/
Multiline Comment:/* start, */End ctrl+shift+/ctrl+shift+\ Cancel
Specification:
1. Same level, left-aligned format code: CTRL+SHIFT+F
2. To be included, to indent (Tab)
3. Class naming, Pascal (the first letter of each word capitalized, other letters lowercase), see the name of righteousness such as MySchool
To import a project:
Menu bar First (File), oblique-down arrow (Import), first plus sign expand, select Longest-click browse button, select the project folder->finish
Show line number:
Left scroll bar right click to check Show line numbers
To configure the environment variables for the JDK:
1) Create a variable in the system variable
Name: Java_home
Value: is the path where you install the JDK, for example: D:\MyEclipseY2\jdk1.6.0_24
2) Locate the path variable in the system variable
Java chapter I first read Java