1. Java background, features, versions, and Java Development Tools
Applet browser appletviewer: Java small application Browser
Syntax: appletviewer [Options] URL
For example, the helloapplet.html file under the current directory:
Appletviewer helloapplet.html
Java compiler javac
Syntax: javac [Options] [sourcefiles]
For example, javac hello1.java hello2.java
Java interpreter
Syntax: Java [Options] class [arguments...]
Java helloworld
Note that there is no file name suffix.
Java document builder javadoc
API documentation for generating source files
Syntax: javadoc [Options] [package name] [source file]
By default, javadoc does not process private member variables and methods. You can use option-private to control private options.
For example, javadoc-private-d c: \ doc com. mypackage helloworld. Java
Generate the HTML document of helloworld. Java in COM. mypackage under the current directory.
C: \ doc.
2. basics and specifications
Note
// Single line comment
/*... */Multi-line comment
/**... */The document comment will be added to the javadoc document.
Identifier and keyword
Basic Data TypeIntBooleanChar long float doubleByte
Access control private public protected
Class-relatedClass extendsAbstract interface implementsNew this super
Method-related void return
Control statement if else switch case for while break continue default
Logical value true false note that they are Java keywords
Exception try catch finally throw throws
Network socket serversocet
OthersPackage import final staticNative synchronized
Operator
Object operator instanceof
A instanceof B returns a Boolean value. If a is an object of Class B, true is returned.
System. Out. println ("ABCDE" instanceof string); Output True
Code Specification
Class, Interface Name: the first letter in upper case, each word in upper case
Attribute name: all letters of the first word are in lowercase, and the first letters of other words are in uppercase.
Set get
Returns the Boolean is has can
Constant: uppercase letters
Program Control statement
If else
Switch
For
While
Do while
Break continue omitted