JavaSE -01java language knowledge base

Day1

Common DOS command

d: Enter letter to switch
dir (directory) lists the current documents and files in the directory folder
md (make directory) to create a directory
rd (remove directory) remove directory
cd (change directory) into the specified directory
cd .. return to the previous directory
cd to return to the root directory
del delete a bunch of files to delete the same file extension .txt *
exit to exit the dos command line
cls (clear screen) clear screen

Written in Java tools

Notepad
Editplus (already configured)
the Eclipse
MyEclipse

Common Errors

A. Can not find file: file extension hidden compilation fails, the file name wrong

B. misspelled words: Class✖string✖system✖

C. matching parenthesis: braces, the braces method body member class, the output statement parentheses

D. in English problem: English written in Chinese characters will prompt an error: Illegal characters: ???? QQ input method properties - Chinese state English punctuation

Java language written format (convention)

  1. To align the braces, and write in pairs
  2. A space before the opening brace
  3. Encounter left brace Tab to indent
  4. Method and blank lines between program blocks clearer
  5. Spaces between statements side by side, such as for statement
  6. Operators spaces on both sides

Keyword

Is assigned a specific meaning Java language words, can not be used as the class name. All lowercase letters keyword.
Editplus for keywords with special color-coded, very intuitive
for defining data types the keyword
class interface byte short int long float double char boolean void
keyword is used to define the data type value
true false null
keyword is used to define the process control
if else switch case default while do for break continue return
keyword qualifier is used to define access
private protected public
for defining classes, functions, variables modifier key
abstract final static synchronized
keyword is used to define the relationship between classes and class
extends implements
keyword to create an instance of the definition, the determination instance
new this super instanceof
keywords for exception handling
try catch finally throw throws
keyword for the package
package import
other modifier keywords
native strictfp transient volatile assert

Identifier

Is a sequence of characters used for classes, interfaces, methods, variables, and so from the name
rule: English uppercase and lowercase letters, numbers, characters, and $ _
Note: You can not start with a number, not a keyword, case sensitive
Hello World✖ 2B✖ Demo # ✖ a12.3✖

name

Package (actually a folder, the same class name used to solve problems) requires all lowercase name, usually the company name written backwards www.heima.com com.heima. Package role
class or interface if it is a word, the first letter If multiple words are capitalized, beginning from the second word capitalized (hump)
methods and variables a word, each letter lowercase more words, began to capitalize the first letter of the second word from the
constants a word, all capital letters more than one word, all capital letters, separated by _

Guess you like

Origin www.cnblogs.com/albieh/p/12174682.html