CSC 241- Lab 3 (Due October 14, 1999)


Theme ...

This lab will help you learn about linked lists. You will also become familiar with packaging, classfication, and polymorphism in Java and Object Oriented Design in general. Based on the class hierarchy built for Queue you will build a the components of the class hierarchy for Stack.


Create directories and copy some files

  1. cd public-html/classes/csc241
  2. cp -r ~mohammad/public-html/classes/csc241/Queue . -- don't forget the dot or the -r. This command replicates my Queue directory and places it in your account.
  3. chmod og+rx Queue

Compile Java files and run the test programs

  1. Use javac to compile each of the above .java files. In any directory, javac *.java will compile all Java files in that directory. So, in the Queue directories compile the .java files.
  2. Run the program that tests Queue.

Create the Stack class hierarchy

You need to create the Stack directory and the three files Stack.java, fixedStack.java, and dynamicStack.java and compile them. These files need to be packaged as csc241.Stack. You will also need to create testStack directory as it exists for the the Queue package as well and test to make sure your Stack classes work correctly.


What to Turn In

Stack.java, fixedStack.java, dynamicStack.java, and test.java (for stacks).