Java programming notes 1 Basic Java knowledge

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.