CS1010 -- Week 3 Lecture 1: Numbers/Simple I/O
Winter 2005-2006
Topics
Primitive types
- Primitive types: byte, short, int, long, float, double, boolean, and char
- Assignment statement
- Reference vs. primitive types
Arithmetic expressions
- Arithmetic operators: +, -, *, /, %
- Integer division
- Binary/unary operations
- Precedence rules: (), unary, (*, /, %), (+, -)
- Typecasting
- Numeric promotion: implicit type casting
- Assignment conversion
- Shorthand assignment operations: *=, /=, +=, -=, and %=
Standard input/output
Math class
- Math class with class methods