Java NOTE 2

Source: Internet
Author: User

Key words
Annotation characters
Comments
Constants and variables
Operator
Statement
Function
Array


---keyword is a word that is given a specific meaning by the Java language
---characters that make up a keyword are all lowercase
---keyword considerations
Goto and const as reserved words

---Identifiers to classes, interfaces, methods, variables, etc. names are used by the character sequence
Composition rules: English uppercase and lowercase alphanumeric characters $ and _
Precautions
/*
Markers are names for classes, interfaces, methods, variables, etc.

Composition rule:
English letter Case
numeric characters
$_
Precautions:
Cannot start with a number
cannot be a Java keyword
Case sensitive

Naming conventions common to identifiers
1, see the name of the idea
2, Package: In fact, the folder is used to distinguish the same class name
All lowercase
Single-stage Package Liuyi
Multi-level package Cn.jiemoxiaodi

Class or interface:
A word composition: The first letter of the word must be capitalized
Example: Student,dog
Multiple words
Example: Helloworld,studentname

Methods and variables:
One word: The first letter of the word lowercase
Multiple words: Starting with the second word, capitalize the first letter of each word

Constant:
One word: all caps
Multiple words: Each letter is capitalized, the word is separated by _
Example: Student_max_age
*/

/*
Note: Text used to interpret the description program
Classification and formatting of annotations in Java

Single-line Comment://can be nested with
Multiline Comment: cannot be nested using
Document comment: Generated by Javadoc tool parsing a document
*/
This is my note.
/*
Constant Demo

Classification:
A: Literal constants
B: Custom Constants


Literal constants:
A: The contents of a string constant enclosed in double quotation marks
Example: "Hello"
B: Integer Constants
C: Decimal constant
D: Character Constant "
E: Boolean Constants
F: Empty constant null
*/
/*
Constant Demo

Classification:
A: Literal constants
B: Custom Constants


Literal constants:
A: The contents of a string constant enclosed in double quotation marks
Example: "Hello"
B: Integer Constants
C: Decimal constant
D: Character Constant "
E: Boolean Constants
F: Empty constant null
*/
1byte=8bit
1k=1024byte
1m=1024kb
1g=1024m
1=1024g

/*
Different binary data performance:
Binary: consists of 0 1, starting with 0b
Octal starting from 0---7 with 0
Decimal by 0---9 by default is decimal
Hex 0---9 a b c D E F start with 0x
*/

Java NOTE 2

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.