Computer Science (CSCI) Department
College of Engineering, Computer Science, & Technology (ECST)

JETT Workshops
Java Basics

Fall 2004


Operators

Exercise - continue to modify project Bank and play with the debugger

  • play with the the arithmetic operators
    • create some local variables of different numeric types
    • assign a variety of values to them
    • write expressions using the variables and the arithmetic operators
    • implement an integer division
    • use the increment and decrement operators
    • step through your code with the debugger and watch the variables change
  • play with assignment and the combined arithmentic/assignment operators
    • when do you need parentheses
  • when do you need a cast
    • try to assign an int to a double
    • try to assign a double to an int
    • demonstrate truncation towards zero
    • round a positive number
    • round a negative number