Java learns from zero (identifiers and keywords)

Source: Internet
Author: User

identifiers, keywords, commentsFirst, identifiers

The names of packages, classes, methods, parameters, and variables in Java consist of any order of size letters, numbers, underscores (_), and dollar signs ($).

Identifier: Cannot start with a number and cannot be a reserved keyword in Java

such as: Yourname, Yourname_dxh, Li_yourname, $yourname are legal identifiers

Class, 67.9,hello World is not legal, class is the keyword, 67.9 starts with a number, there is a space in the middle of Hello world

Second, the key word

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

Third, comments
    • Single-line Comment:
// represents a single-line comment, where the comment is in the comment line, preceded by a double slash (//) before the content needs to be commented
    • Multi-line Comments:
/* * Multiline comment, beginning with a single slash plus a Star (/*), ending with a single slash (*/) in the star */
    • Document comments

/** * Document Comments * Preceded by a single slash plus two star marks (/**), with a star marker and a slash (*/) End * The content of this method annotation will be interpreted as the official document of the program, And can be included ina document generated by tools such as: Javadoc * * *

Java learns from zero (identifiers and keywords)

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.