java basic syntax of identifiers, etc.

First, the basic syntax
1, case sensitive
2, class name capitalized
3, the method is a function, start with lowercase.
4, the source file name should be the same as the class name, the file name suffix .java
. 5, main entrance Method: Java program begins execution by the public static void main (String [] args).
Second, the identifier: class names, method names, variable names as identifiers
1 to uppercase and lowercase letters, $, _ at the beginning, followed by numbers, letters, dollar signs, underscores in any combination of
2, not keywords as an identifier
3 ,Case Sensitive! ! !
Third, the modifier
access modifiers: default, protected, public, private .
Non-access modifiers. (It is not known what is)
four, JAVA variables
local variables, class variables (static), member variables (non-static).
V. array, enum
VI Note: C ++ and similar supports single "//"; multi-line backslash asterisk way.
Seven inheritance
in Java, a class can be derived from the other classes. If you want to create a class, but already there is a class has a property or method you need, then you can create a new class that inherits the class. Using inherited methods, the class can reuse existing methods and properties, but without rewriting code. Inherited class called superclass (super class), derived class is called a subclass (subclass).
Eight Interface
In Java, understood as the interface protocol between objects communicate with each other. Interface defines the method to use to derive, but the specific implementation of the method depends entirely on the derived class.
Nine, java compiler way
.java- compile -.> Class- interpreted ->. . . . . .

Guess you like

Origin www.cnblogs.com/gamecenter/p/11520511.html