Most Sample Code from "Java How to Program, Fifth Edition" from Deitel and Deitel.


Command line Arguments

Code: Echo.java


Command Line Arguments with Integers

Code: IntCommand.java


Discussion on Wrapper classes:

Experimented with Object tool

made an "int" variable and made an "Integer" variable and viewed the difference in Object Tool

From "Java How to Program 5th Edition":
"Each primitive type (such as double) has a corresponding class (such as Double) in package java.lang. These classes (called type-wrapper classes) provide methods for processing primitive type values (such as converting a String to a primitive-type value or vice versa.)" (page 105)
"Each type wrapper class enables you to manipulate primitive type values as objects" (page 485)


Linked-Lists

Overview of a Self-Referential Class:

class Node {
    private int data;
    private Node nextNode;

    public Node ( int data ) { /* constructor body */ }

    public void setData ( int data ) { /* method body */ }

    public int getData () { /* method body */ }

    public void setNext (Node next ) { /* method body */ }

    public node getNext ()  { /* method body */ }
}
     

Code for the linked list:

List.java
ListTest.java
EmptyListException.java

Exercise