Computer program: A set of ordered sets of instructions produced by a computer to accomplish certain functions.
Java technology includes: Javase (Standard Edition) Java EE (Enterprise Edition)---javame (mobile version)
development Java program steps: 1. Write 2. Compile 3. Run.
1. Write:
a. Curly braces appear in pairs
The words following the span style= "font-size:18pt" >b.class are identical to 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, unreadable, garbled)
(note!!! If the code is modified, it needs to be recompiled and run)
3. Run:
Command: Java file name (no suffix!!)
produces the result: 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
Chapter One: first knowledge of Java