1.0 Escape Character
\ n: newline, \ nthe function is the same as ln behind print, and can be used as appropriate
\ t: A tab stop (a series of spaces)
Cases:
1 Public classschedule{2 Public Static voidMain (string[] args) {3SYSTEM.OUT.PRINTLN ("\t\t* Timetable *");4System.out.println ("--------------------------------------------------");5SYSTEM.OUT.PRINTLN ("Week \ t \t\t pm");6System.out.println ("--------------------------------------------------");7System.out.println ("Monday \ t English \t\t high number");8System.out.println ("Tuesday \ t political \t\t computer network");9System.out.println ("Wednesday \tc++\t\tjava");TenSystem.out.println ("Thursday \ t data structure \t\tjava"); OneSystem.out.println ("Friday \ t database \t\t operating system"); ASystem.out.println ("--------------------------------------------------"); - } - the}
This code outputs effects such as:
What are the annotation types for 2.0 Java?
Parsing: The role of annotations: 01. Facilitate later maintenance of the project
02. Facilitate the reading of members within the team
03. Comments will not be compiled by the Java compiler, Java compilation will be skipped comments
Why write comments: In order to follow us to read the code convenient, so we have to develop the habit of writing notes,
Because the comments accounted for three points during the final exam, the comments accounted for a large proportion during the interview.
First: single-line Comment//shortcut: ctrl+/
The second type: Multiline comment/**/shortcut key: ctrl+shift+/
If the cursor renders a relatively wide style, press the INSERT key on the keyboard to restore the cursor.
3.0 notes for writing Java programs:
01.java code is strictly case sensitive.
02. Curly braces to appear in pairs
03. Write the left curly brace ({) At the end of a line of code
04. The code should be written into the inner frame.
05. All the code we write is in the English half-width state, otherwise error may occur
Each statement in 06.java is separated by a semicolon ";" End
07. Class names cannot start with a number
-------------------------------above updated on 2015.07.24
Java Common knowledge (long-term update)