Java annotation named data type basic type conversion bit operator logical operator Trinocular operator

Source: Internet
Author: User

One. Java annotations

1. Single-line comment//comment content

2. Multi-line Comment/* Comment content */

3. Documentation Comments (Use Javadoc tool to generate API documentation, but I haven't tried)/** document comments */, document comments can see annotations when they are used.

Common markup for document comments

@auther Author @version version @deprecated It is not recommended to use @param this parameter @return return value @throws exception, same as @exception

Two. Naming of Java

1. Project name All lowercase

2. Package name All lowercase

3. Class name First Capital plus hump

4. Method name, variable name first letter lowercase plus hump

5. Constant name all uppercase (less used)

6. Cannot start with a number, only consists of letters, numbers, underscores, $ symbols, not Java key or reserved words

Three. Java data type (base type, reference type)

1. Integral type

BYTE memory accounted for 8 bits -2^7 to 2^7-1

Short memory 16-bit -2^15 to 2^15-1

int memory accounted for 32 bits -2^31 to 2^31-1

Long memory accounted for 64 bits -2^63 to 2^63-1 (declare variable if the length does not need to add L or L will compile an error)

If an integer assignment exceeds the range of the shape, it can cause overflow

2. Character type

Char This type has many features that can be used with a single character as a variable or in Unicode encoding to declare a variable if strong to int translates into a number corresponding to a Unicode character

3. Floating-point type

Float (declare variable to add f)

Double

(Reference type BigDecimal for high-precision mathematical computations using this class of their own method)

(cannot be divided by 0, will throw an exception, but divided by 0.0 does not, the result is infinite, if the floating-point data divided by 0, the result is also infinitely large)

4. Boolean type

Boolean (True False)

(Reference type String Object)

Four. Basic Type Conversions

Principle big turn small strong turn, small turn nature turn, arithmetic operation Natural turn big (Byte,short,char will be converted into int)

(It's worth noting that the base data types and their reference types are equal, and if the base data types and their reference types have the same values and do not declare the object, then the result of = = is true,

If the object (new) is declared, the = = result between the object and the object is false, and the result of the variable and object = = is also false

)

Five. Bitwise operators

& according to the most common difference between the && is in logical judgment && once the condition is not satisfied will terminate & will always read the entire condition, in addition && can only be used for logic judgment,& can be used in the digital operation, involving 2 binary principle , not good explanation

| Bitwise OR WITH | | The most common difference is in logical judgment | | Once the condition is met, it will be terminated | The entire condition will be read and played, in addition | | Can only be used for logic judgments, | can be used in digital operations, involving 2 binary principle, not good explanation

~ Bitwise non-comparison is not common, ~ can be used in digital operations, involving 2-binary principle, not good explanation

^ Bitwise XOR or less common, ^ can be used in numeric operations, involving 2 binary principle, not good explanation

<< >> >>> The left and right shift operators, and the no-sign shift operators, rarely use the ibid

The above can be extended to the copy operator followed by the equals sign = 2 code involved, bad interpretation of use, and principle

  

Six. Logical operators, trinocular operators

! Returns a value other than the current Boolean

^ XOR if the Boolean values on both sides of the same return false are different then estoppel true less used

(Boolean)? True do:false do front condition, and then performs true do or false based on the Boolean judgment of the condition

Seven. The precedence of the operator (with a blank add-on line)

Java annotation named data type basic type conversion bit operator logical operator Trinocular operator

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.