Data Types

Objective #1: List the primitive data types and their characteristics.

Objective #2: Explain how primitive types are copied and be able to trace their values.

Objective #3: Explain the problem of overflow.

Objective #4: Explain the problem of loss of precision and round-off errors that can occur and be able to work around it.

Objective #5: Explain integer division and how to avoid it when desired.

Objective #6: Use the Integer and Double wrapper classes.

public class IntegerExample
{
   public static void vegas(Integer num2)
   {
      num2 = num2.intValue() + 1;
      System.out.println(num2);  // 6 is displayed
   }

   public static void main(String[] args)
   {
      Integer num1 = new Integer(5);

      vegas(num1);
      System.out.println(num1);  // 5 is displayed
   }
}