Data type
A) number ( int(integer), double-precision floating-point double (decimal))
b) Character type (char), storing a single character
c) string character (string), storing multiple characters
Boolean Data types
Boolean: A value of TRUE or False
Assignment: The boolean variable name =true or false or an expression;
Data type Conversions ( for numeric types )
1, divided into 2 major categories:
numeric type (int, double),
Non-numeric type (character ', String ', Boolean type bool)
2. Data type Conversion classification
A) automatic type conversion--"P41 page"
I. Rule 1: If one operand is of type double, the entire expression can be promoted to a double type
Ii. Rule 2: Conditions for automatic type conversions are met.
Two types are compatible: numeric types (int and floating-point double)
Destination type is greater than Source type: Double type can hold int type,(int-->double"enlarge transform")
b) Coercion type conversion: Target type variable name = (target type) variable or expression;
"A value of type double, saved to the INT type variable"
int variable name =(int)a value or variable of type double;
Java Data types