Lecture 4 (Chapter 2)
Lecture 4 (Chapter 2)
Lecture 4
Chapter 2:
Introduction to Java Programming
1
Increment and decrement:
2
Modify-and-assign:
3
Increment- Decrement
Pre increment - Post increment
post
pre
7
Trace:
8
Type casting:
9
Examples:
10
Example:
Example:
All integers
casting
char data type
Output:
students
char vs. int
• Each char is mapped to an integer value internally
• Called an ASCII value
Output:
e
100
16