Java learns from scratch (identifiers and keywords), starts from scratch and

Source: Internet
Author: User

Java learns from scratch (identifiers and keywords), starts from scratch and
Identifier, keyword, comment 1, identifier

The packages, classes, methods, parameters, and variable names in Java are composed of letters, numbers, underscores (_), and dollar signs ($) in any order,

Identifier: it cannot start with a number or be a reserved keyword in JAVA.

For example, yourname, yourname_dxh, li_yourname, and $ yourname are all valid identifiers.

Class, 67.9, Hello World is illegal, class is a keyword, 67.9 starts with a number, there is a space in the middle of Hello World

Ii. Keywords

Keywords in Java

 

Abstract Boolean Break Byte Case Catch Char
Class Continue Default Do Double Else Extends
False Final Finally Float For If Implements
Import Instanceof Int Interface Long Native New
Null Package Private Protected Public Return Short
Static Synchronized Super This Throw Throws Transient
True Try Void Volatile While Assert Enum

 

3. Notes
  • Single line comment:
// Indicates a single line comment. The comment content is here, and a line is commented. Add a double slash before the content to be commented (//)
  • Multi-line comment:
/** Multi-line comment, starting with a single slash plus a star (/*), ending with a star plus a single slash */
  • Document comment

 

/*** Document comments * start with a single slash plus two star tags (/**), and add a slash to a star tag (*/) at the end of * The content annotated with this method will be interpreted as a formal document of the program and can be included in the document generated by a tool such as javadoc */

 

 

 

 

 

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.