Comp 333 - Concepts of Programming Languages - Lab 1
Class-based Inheritance and Virtual Dispatch
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
For Mac/Linux:
- Compile with:
javac -cp .:hamcrest-2.2.jar:junit-4.13.jar -Xlint:all ImmutableList.java Cons.java Nil.java ImmutableListTest.java
- Run with
java -cp .:hamcrest-2.2.jar:junit-4.13.jar org.junit.runner.JUnitCore ImmutableListTest
For Windows Powershell:
-
Compile with:
javac -cp '.;hamcrest-2.2.jar;junit-4.13.jar' -Xlint:all ImmutableList.java Cons.java Nil.java ImmutableListTest.java
-
Run with:
java -cp '.;hamcrest-2.2.jar;junit-4.13.jar' org.junit.runner.JUnitCore ImmutableListTest