Next:
Summary
Up:
All Units
Unit 4
Primitive data types in Java
Summary
Data types in mathematics
Primitive data types in Java
The data type
int
Variables of primitive types and variables of type reference to an object
Methods that modify variables of primitive types
Wrapper classes for the primitive data types
Reading of numbers of type
int
Writing of numbers of type
int
Integer expressions
Numeric overflow
Combined assignment operators
Increment and decrement operators
Expressions with side-effect and statements (optional)
Definition of constants and magic numbers
Other primitive data types for integer numbers:
byte
Other primitive data types for integer numbers:
short
Other primitive data types for integer numbers:
long
Primitive data types for real numbers:
double
Primitive data types for real numbers:
float
Reading of numbers of type
double
or
float
Writing of numbers of type
double
or
float
Exercise: the class
BankAccount
Solution for the class
BankAccount
Precision in the representation: rounding errors
Precision in measures
Predefined static methods for mathematical operations
Expressions that involve different primitive numeric types
Assignments between different primitive numeric types
Explicit type conversion (casting)
The primitive data type
char
Operations that involve values of type
char
Boolean algebra: domain and operators
Boolean expressions with variables: truth tables
The primitive data type
boolean
Expressions of type
boolean
Comparison operators
Comparing floating point numbers
Predicates
Precedence between operators of different types
Exercises
Next:
Summary
Up:
All Units