Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 954 Bytes

README.md

File metadata and controls

24 lines (20 loc) · 954 Bytes

Immutable List in Java

Comp 333 - Concepts of Programming Languages - Lab 1
Class-based Inheritance and Virtual Dispatch

Description

By the time you have completed this work, you should be able to:

  • Use class-based inhertance to implement different behaviours for the same method
  • Implement an immutable list
  • Use recursion to implement basic list operations

Quick Start

For Mac/Linux:

  1. Compile with:
    javac -cp .:hamcrest-2.2.jar:junit-4.13.jar -Xlint:all ImmutableList.java Cons.java Nil.java ImmutableListTest.java
  2. Run with
    java -cp .:hamcrest-2.2.jar:junit-4.13.jar org.junit.runner.JUnitCore ImmutableListTest

For Windows Powershell:

  1. Compile with:
    javac -cp '.;hamcrest-2.2.jar;junit-4.13.jar' -Xlint:all ImmutableList.java Cons.java Nil.java ImmutableListTest.java

  2. Run with:
    java -cp '.;hamcrest-2.2.jar;junit-4.13.jar' org.junit.runner.JUnitCore ImmutableListTest