A note
Single-line Comment://
Multiline Comment:/* */
Document Note:/**
*/
Because only public or protected-modified content is what you want to expose to others, and the API documentation primarily provides information to the consumer, JAVADAOC only handles public or protected-modified content by default. If the developer really wants the Javadoc tool to extract the contents of the private adornment, you can add the-private option when using the Javadoc tool.
The Javadoc tool does not extract information from the @author and @version two tags by default, and if necessary, you should specify-author and-version two options when using the Javadoc tool.
Two data types
- Base type (primitive type):
-
- Boolean type 1-bit
- numeric type:
- integer Type (default integer is int)
- byte 1 byte -2^7 ~ 2^7-1
- short 2 bytes -2^15 ~ 2^15-1
- int 4 bytes -2^ ~ 2^31-1
- long 8 bytes -2^63 ~ 2^63-1
- Char 2-byte
- floating-point type (default floating-point number is double)
- float 4 bytes (the 1th bit is the sign bit, the next 8 bits represent the exponent, and the next 2 bits indicate the mantissa)
-  D Ouble 8 bytes (The 1th bit is the sign bit, the next 11 bits represent the exponent, then the next 52 bits represent the mantissa)
- Reference type (reference type):
- Class
- Interface
- Array
- Null
The computer saves all integers in the form of a complement. Complement calculation rule: positive complement and the original code is exactly the same, negative complement is its anti-code plus one, anti-code is to the original code bitwise reverse, but the highest bit (sign bit) remains unchanged.
Positive Infinity: double.positive_infinity or Float.positive_infinity
Negative Infinity: double.negative_infinity or Float.negative_infinity
Non-number: Double.NaN or Float.nan
All positive infinity values are equal, all negative infinity values are equal, and Nan is not equal to any numeric value, even to Nan.
Only the floating-point number divided by 0 can get positive infinity and negative infinity, because Java automatically treats divisor 0 as 0.0. However, if an integer value is divided by 0, an exception is thrown: java.lang.ArithmeticException:/by zero
eg
Public classTestDate { Public Static voidMain (string[] args) {/** Date date = new Date (1474496229424L); SYSTEM.OUT.PRINTLN (date); */ floatAF = 5.2345556f; SYSTEM.OUT.PRINTLN (AF); DoubleA = 0.0; Doublec =double.negative_infinity; floatD =float.negative_infinity; System.out.println (c==d); System.out.println (A/a); System.out.println (A/A = =Float.nan); System.out.println (6.0/0 = = 555.0/0); System.out.println (-8/a); System.out.println (0/0); }}
Output Result:
5.2345557
True
NaN
False
True
-infinity
Exception in thread "main" java.lang.ArithmeticException:/By zero
At Com.citi.icg.portal.resource.service.impl.TestDate.main (testdate.java:22)
- Java7 using underscores in new values
By using underscores to separate values, you can more visually distinguish how many bits are contained in a numeric constant.
"Crazy Java Handout" (v)----data types