europeans = new ArrayList();
+
+ europeans.add(new French());
+ europeans.add(new German());
+ europeans.add(new Russian());
+ europeans.add(new Italian());
+
+ for(European man: europeans) {
+ man.whatCountry();
+ man.beforeChrist();
+ man.practiceReligion();
+ man.speakLanguage();
+ man.WWI();
+ man.WWII();
+ }
+ }
+ public static void testWithArrayOfObjects() {
+ European[] europeans = {
+ new French(),
+ new German(),
+ new Russian(),
+ new Italian()
+ };
+ for (European person: europeans) {
+ person.whatCountry();
+ person.beforeChrist();
+ person.practiceReligion();
+ person.speakLanguage();
+ person.WWI();
+ person.WWII();
+ }
+ }
+ public static void testWithArrayOfInterfaces() {
+ Interface[] interfaceArr = {
+
+ }
+ }
+ public static void main(String[] args)
+ {
+ testWithArrayList();
+ System.out.println("-------------------");
+ testWithArrayOfObjects();
+ }
+}
diff --git a/Semester 2/Assignments/lab8_2_CalebFontenot/src/main/java/com/calebfontenot/lab8_2_calebfontenot/interfacesGrouped/fun/War.java b/Semester 2/Assignments/lab8_2_CalebFontenot/src/main/java/com/calebfontenot/lab8_2_calebfontenot/interfacesGrouped/fun/War.java
new file mode 100644
index 0000000..f49ed3f
--- /dev/null
+++ b/Semester 2/Assignments/lab8_2_CalebFontenot/src/main/java/com/calebfontenot/lab8_2_calebfontenot/interfacesGrouped/fun/War.java
@@ -0,0 +1,14 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Interface.java to edit this template
+ */
+package com.calebfontenot.lab8_2_calebfontenot.interfacesGrouped.fun;
+
+/**
+ *
+ * @author caleb
+ */
+public interface War {
+ void WWI();
+ void WWII();
+}
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Animal.html b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Animal.html
new file mode 100644
index 0000000..4590f64
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Animal.html
@@ -0,0 +1,38 @@
+
+
+
+Animal.java
+
+
+
+
+/home/caleb/ASDV-Java/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Animal.java |
+
+
+nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
+nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
+
+package com.calebfontenot.lab8_calebfontenot;
+
+
+
+@author
+
+public abstract class Animal {
+ public abstract String sound();
+}
+
+
+
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Apple.html b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Apple.html
new file mode 100644
index 0000000..c7b5377
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Apple.html
@@ -0,0 +1,44 @@
+
+
+
+Apple.java
+
+
+
+
+/home/caleb/ASDV-Java/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Apple.java |
+
+
+nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
+nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
+
+package com.calebfontenot.lab8_calebfontenot;
+
+
+
+@author
+
+public class Apple extends Fruit{
+
+ @Override
+ public String howToEat()
+ {
+ return "Apple: Make apple cider.";
+ }
+}
+
+
+
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Brocoli.html b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Brocoli.html
new file mode 100644
index 0000000..8c73102
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Brocoli.html
@@ -0,0 +1,42 @@
+
+
+
+Brocoli.java
+
+
+
+
+/home/caleb/ASDV-Java/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Brocoli.java |
+
+
+nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
+nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
+
+package com.calebfontenot.lab8_calebfontenot;
+
+
+
+@author
+
+public class Brocoli extends Fruit {
+ @Override
+ public String howToEat() {
+ return "Brocolli: Steam it";
+ }
+}
+
+
+
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Chicken.html b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Chicken.html
new file mode 100644
index 0000000..187a942
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Chicken.html
@@ -0,0 +1,47 @@
+
+
+
+Chicken.java
+
+
+
+
+/home/caleb/ASDV-Java/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Chicken.java |
+
+
+nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
+nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
+
+package com.calebfontenot.lab8_calebfontenot;
+
+
+
+@author
+
+public class Chicken extends Animal implements Edible {
+ @Override
+ public String sound() {
+ return "Chicken: cock-a-doodle-do!";
+ }
+ @Override
+ public String howToEat() {
+ return "Chicken: Fry it!";
+ }
+}
+
+
+
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Duck.html b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Duck.html
new file mode 100644
index 0000000..5205b0d
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Duck.html
@@ -0,0 +1,47 @@
+
+
+
+Duck.java
+
+
+
+
+/home/caleb/ASDV-Java/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Duck.java |
+
+
+nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
+nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
+
+package com.calebfontenot.lab8_calebfontenot;
+
+
+
+@author
+
+public class Duck extends Animal implements Edible {
+ @Override
+ public String howToEat() {
+ return "Duck: Roast it!";
+ }
+
+ @Override
+ public String sound() {
+ return "Duck: Quack! Quack! Quack!";
+ }
+}
+
+
+
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Edible.html b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Edible.html
new file mode 100644
index 0000000..da3086d
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Edible.html
@@ -0,0 +1,39 @@
+
+
+
+Edible.java
+
+
+
+
+/home/caleb/ASDV-Java/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Edible.java |
+
+
+nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
+nbfs://nbhost/SystemFileSystem/Templates/Classes/Interface.java
+
+package com.calebfontenot.lab8_calebfontenot;
+
+
+
+@author
+
+public interface Edible {
+ String howToEat();
+}
+
+
+
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Fruit.html b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Fruit.html
new file mode 100644
index 0000000..14fb4e0
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Fruit.html
@@ -0,0 +1,37 @@
+
+
+
+Fruit.java
+
+
+
+
+/home/caleb/ASDV-Java/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Fruit.java |
+
+
+nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
+nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
+
+package com.calebfontenot.lab8_calebfontenot;
+
+
+
+@author
+
+public abstract class Fruit implements Edible{
+
+}
+
+
+
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/House.html b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/House.html
new file mode 100644
index 0000000..8035374
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/House.html
@@ -0,0 +1,164 @@
+
+
+
+House.java
+
+
+
+
+/home/caleb/ASDV-Java/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/House.java |
+
+
+nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
+nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
+
+package com.calebfontenot.lab8_calebfontenot;
+
+import java.util.Date;
+
+
+
+@author
+
+public class House implements Cloneable{
+
+ private int id;
+ private double area;
+ private Date whenBuilt;
+
+ public House(int id, double area)
+ {
+ this.id = id;
+ this.area = area;
+ this.whenBuilt = new Date();
+ }
+
+ @Override
+ protected Object clone() throws CloneNotSupportedException
+ {
+ Object o = super.clone();
+ ((House) o).whenBuilt = new Date(this.whenBuilt.getTime());
+ return o;
+ }
+
+
+
+
+
+
+@return
+
+ public Date getWhenBuilt()
+ {
+ return whenBuilt;
+ }
+
+
+
+
+@param whenBuilt
+
+ public void setWhenBuilt(Date whenBuilt)
+ {
+ this.whenBuilt = whenBuilt;
+ }
+
+
+
+
+
+@return
+
+ public double getArea()
+ {
+ return area;
+ }
+
+
+
+
+@param area
+
+ public void setArea(double area)
+ {
+ this.area = area;
+ }
+
+
+
+
+@return
+
+ public int getId()
+ {
+ return id;
+ }
+
+
+
+
+@param id
+
+ public void setId(int id)
+ {
+ this.id = id;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "House{" + "id=" + id + ", area=" + area + ", whenBuilt=" + whenBuilt + '}';
+ }
+
+ public int compareTo(House o) {
+ if (this.getId() == o.getId() &&
+ this.getArea() == o.getArea() &&
+ this.getWhenBuilt().equals(o.getWhenBuilt())) {
+ return 0;
+ }
+ if (this.area > o.area) {
+ return 1;
+ } else if (this.area < o.area) {
+ return -1;
+ } else {
+ return -2;
+ }
+ }
+
+public static void main(String[] args) throws CloneNotSupportedException, InterruptedException {
+ House house1 = new House(1, 1000);
+ House house2 = (House) house1.clone();
+ house2.whenBuilt.setDate(8);
+ System.out.println(house1);
+ System.out.println(house2);
+ House house3 = new House(3, 2000);
+ House house4 = new House(4, 2000);
+ System.out.println("house 1 and house 2 are identical: "+ house1.compareTo(house2));
+ System.out.println("house 3 and house 3 have the same area: " + house3.compareTo(house4));
+ System.out.println("House 4 is harger than house 2: " + house4.compareTo(house2));
+
+
+}
+
+}
+
+
+
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Orange.html b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Orange.html
new file mode 100644
index 0000000..6b521bc
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Orange.html
@@ -0,0 +1,45 @@
+
+
+
+Orange.java
+
+
+
+
+/home/caleb/ASDV-Java/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Orange.java |
+
+
+nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
+nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
+
+package com.calebfontenot.lab8_calebfontenot;
+
+import com.calebfontenot.lab8_calebfontenot.Fruit;
+
+
+
+@author
+
+public class Orange extends Fruit {
+
+ @Override
+ public String howToEat() {
+ return "Orange: Make orange juice.";
+ }
+}
+
+
+
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Test.html b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Test.html
new file mode 100644
index 0000000..82ebd23
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Test.html
@@ -0,0 +1,63 @@
+
+
+
+Test.java
+
+
+
+
+/home/caleb/ASDV-Java/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Test.java |
+
+
+nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
+nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
+
+package com.calebfontenot.lab8_calebfontenot;
+
+
+
+@author
+
+public class Test {
+ Edible () {
+ Edible e = new Edible() {
+ @Override
+ public String howToEat() {
+ return "Beans: make a soup";
+ }
+ };
+ return e;
+ }
+
+
+
+
+
+
+
+
+
+
+
+ public static void main(String[] args)
+ {
+ Edible[] = {new Chicken()};
+ }
+}
+
+
+
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/TestEdible.html b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/TestEdible.html
new file mode 100644
index 0000000..61bf59c
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/TestEdible.html
@@ -0,0 +1,90 @@
+
+
+
+TestEdible.java
+
+
+
+
+/home/caleb/ASDV-Java/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/TestEdible.java |
+
+
+nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
+nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
+
+package com.calebfontenot.lab8_calebfontenot;
+
+import java.util.ArrayList;
+
+
+
+@author
+
+
+
+public class TestEdible {
+ public static void testWithArrayList() {
+ ArrayList<Edible> edible = new ArrayList();
+
+ edible.add(new Chicken());
+ edible.add(new Apple());
+ edible.add(new Orange());
+ edible.add(new Duck());
+ edible.add(new Brocoli());
+
+ for (Edible eat: edible) {
+ System.out.println(eat.howToEat());
+ }
+ }
+ public static void testWithArrayOfInterfaces() {
+ Edible[] edible = {
+ new Chicken(), new Apple(), new Orange(), new Duck(), new Brocoli()
+ };
+ for (int i = 0; i < edible.length; ++i) {
+ System.out.println(edible[i].howToEat());
+ }
+ }
+ public static void testWithArrayOfObjects() {
+ Object[] objects = {
+ new Tiger(), new Chicken(), new Apple(), new Duck(), new Brocoli()
+ };
+ for (int i = 0; i < objects.length; ++i) {
+ if (objects[i] instanceof Edible) {
+ System.out.println(((Edible) objects[i]).howToEat());
+ }
+ if (objects[i] instanceof Animal) {
+ System.out.println(((Animal) objects[i]).sound());
+ }
+ }
+ }
+ public static void main(String[] args)
+ {
+ testWithArrayOfObjects();
+ System.out.println("-------------------");
+ testWithArrayOfInterfaces();
+ System.out.println("------------------ ");
+ testWithArrayList();
+ }
+}
+
+
+
+
+
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Tiger.html b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Tiger.html
new file mode 100644
index 0000000..6075795
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/Printed HTMLs/Tiger.html
@@ -0,0 +1,46 @@
+
+
+
+Tiger.java
+
+
+
+
+/home/caleb/ASDV-Java/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Tiger.java |
+
+
+nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
+nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
+
+package com.calebfontenot.lab8_calebfontenot;
+
+
+
+@author
+
+public class Tiger extends Animal {
+
+ @Override
+ public String sound()
+ {
+ return "Tiger: ROAAAAAAAR!";
+ }
+
+}
+
+
+
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/lab8AbstractNinterfaces.pdf b/Semester 2/Assignments/lab8_CalebFontenot/lab8AbstractNinterfaces.pdf
new file mode 100644
index 0000000..5f5621c
Binary files /dev/null and b/Semester 2/Assignments/lab8_CalebFontenot/lab8AbstractNinterfaces.pdf differ
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/pom.xml b/Semester 2/Assignments/lab8_CalebFontenot/pom.xml
new file mode 100644
index 0000000..5d0df92
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/pom.xml
@@ -0,0 +1,14 @@
+
+
+ 4.0.0
+ com.calebfontenot
+ lab8_CalebFontenot
+ 1.0-SNAPSHOT
+ jar
+
+ UTF-8
+ 17
+ 17
+ com.calebfontenot.lab8_calebfontenot.Lab8_CalebFontenot
+
+
\ No newline at end of file
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Animal.java b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Animal.java
new file mode 100644
index 0000000..236cf77
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Animal.java
@@ -0,0 +1,13 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package com.calebfontenot.lab8_calebfontenot;
+
+/**
+ *
+ * @author caleb
+ */
+public abstract class Animal {
+ public abstract String sound();
+}
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Apple.java b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Apple.java
new file mode 100644
index 0000000..97cb907
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Apple.java
@@ -0,0 +1,18 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package com.calebfontenot.lab8_calebfontenot;
+
+/**
+ *
+ * @author caleb
+ */
+public class Apple extends Fruit{
+
+ @Override
+ public String howToEat()
+ {
+ return "Apple: Make apple cider.";
+ }
+}
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Brocoli.java b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Brocoli.java
new file mode 100644
index 0000000..ba274df
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Brocoli.java
@@ -0,0 +1,16 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package com.calebfontenot.lab8_calebfontenot;
+
+/**
+ *
+ * @author caleb
+ */
+public class Brocoli extends Fruit {
+ @Override
+ public String howToEat() {
+ return "Brocolli: Steam it";
+ }
+}
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Chicken.java b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Chicken.java
new file mode 100644
index 0000000..fd03d74
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Chicken.java
@@ -0,0 +1,20 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package com.calebfontenot.lab8_calebfontenot;
+
+/**
+ *
+ * @author caleb
+ */
+public class Chicken extends Animal implements Edible {
+ @Override
+ public String sound() {
+ return "Chicken: cock-a-doodle-do!";
+ }
+ @Override
+ public String howToEat() {
+ return "Chicken: Fry it!";
+ }
+}
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Duck.java b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Duck.java
new file mode 100644
index 0000000..04e3315
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Duck.java
@@ -0,0 +1,21 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package com.calebfontenot.lab8_calebfontenot;
+
+/**
+ *
+ * @author caleb
+ */
+public class Duck extends Animal implements Edible {
+ @Override
+ public String howToEat() {
+ return "Duck: Roast it!";
+ }
+
+ @Override
+ public String sound() {
+ return "Duck: Quack! Quack! Quack!";
+ }
+}
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Edible.java b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Edible.java
new file mode 100644
index 0000000..4117e51
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Edible.java
@@ -0,0 +1,13 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Interface.java to edit this template
+ */
+package com.calebfontenot.lab8_calebfontenot;
+
+/**
+ *
+ * @author caleb
+ */
+public interface Edible {
+ String howToEat();
+}
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Fruit.java b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Fruit.java
new file mode 100644
index 0000000..727c2a4
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Fruit.java
@@ -0,0 +1,13 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package com.calebfontenot.lab8_calebfontenot;
+
+/**
+ *
+ * @author caleb
+ */
+public abstract class Fruit implements Edible{
+
+}
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/House.java b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/House.java
new file mode 100644
index 0000000..d4cc373
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/House.java
@@ -0,0 +1,133 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package com.calebfontenot.lab8_calebfontenot;
+
+import java.util.Date;
+
+/**
+ *
+ * @author caleb
+ */
+public class House implements Cloneable{
+
+ private int id;
+ private double area;
+ private Date whenBuilt;
+
+ public House(int id, double area)
+ {
+ this.id = id;
+ this.area = area;
+ this.whenBuilt = new Date();
+ }
+
+ @Override
+ protected Object clone() throws CloneNotSupportedException
+ {
+ Object o = super.clone();
+ ((House) o).whenBuilt = new Date(this.whenBuilt.getTime());
+ return o;
+ }
+
+
+
+ /**
+ * Get the value of whenBuilt
+ *
+ * @return the value of whenBuilt
+ */
+ public Date getWhenBuilt()
+ {
+ return whenBuilt;
+ }
+
+ /**
+ * Set the value of whenBuilt
+ *
+ * @param whenBuilt new value of whenBuilt
+ */
+ public void setWhenBuilt(Date whenBuilt)
+ {
+ this.whenBuilt = whenBuilt;
+ }
+
+
+ /**
+ * Get the value of area
+ *
+ * @return the value of area
+ */
+ public double getArea()
+ {
+ return area;
+ }
+
+ /**
+ * Set the value of area
+ *
+ * @param area new value of area
+ */
+ public void setArea(double area)
+ {
+ this.area = area;
+ }
+
+ /**
+ * Get the value of id
+ *
+ * @return the value of id
+ */
+ public int getId()
+ {
+ return id;
+ }
+
+ /**
+ * Set the value of id
+ *
+ * @param id new value of id
+ */
+ public void setId(int id)
+ {
+ this.id = id;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "House{" + "id=" + id + ", area=" + area + ", whenBuilt=" + whenBuilt + '}';
+ }
+
+ public int compareTo(House o) {
+ if (this.getId() == o.getId() &&
+ this.getArea() == o.getArea() &&
+ this.getWhenBuilt().equals(o.getWhenBuilt())) {
+ return 0;
+ }
+ if (this.area > o.area) {
+ return 1;
+ } else if (this.area < o.area) {
+ return -1;
+ } else {
+ return -2; // Same area for this and o but either var id or var whenBuilt are different
+ }
+ }
+
+public static void main(String[] args) throws CloneNotSupportedException, InterruptedException {
+ House house1 = new House(1, 1000);
+ House house2 = (House) house1.clone();
+ house2.whenBuilt.setDate(8);
+ System.out.println(house1);
+ System.out.println(house2);
+ House house3 = new House(3, 2000);
+ House house4 = new House(4, 2000);
+ System.out.println("house 1 and house 2 are identical: "+ house1.compareTo(house2));
+ System.out.println("house 3 and house 3 have the same area: " + house3.compareTo(house4));
+ System.out.println("House 4 is harger than house 2: " + house4.compareTo(house2));
+
+
+}
+
+}
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Lab8_CalebFontenot.java b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Lab8_CalebFontenot.java
new file mode 100644
index 0000000..bb464b9
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Lab8_CalebFontenot.java
@@ -0,0 +1,16 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ */
+
+package com.calebfontenot.lab8_calebfontenot;
+
+/**
+ *
+ * @author caleb
+ */
+public class Lab8_CalebFontenot {
+
+ public static void main(String[] args) {
+ System.out.println("Hello World!");
+ }
+}
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Orange.java b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Orange.java
new file mode 100644
index 0000000..2a66f3b
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Orange.java
@@ -0,0 +1,19 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package com.calebfontenot.lab8_calebfontenot;
+
+import com.calebfontenot.lab8_calebfontenot.Fruit;
+
+/**
+ *
+ * @author caleb
+ */
+public class Orange extends Fruit {
+
+ @Override
+ public String howToEat() {
+ return "Orange: Make orange juice.";
+ }
+}
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Test.java b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Test.java
new file mode 100644
index 0000000..92d63c6
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Test.java
@@ -0,0 +1,36 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package com.calebfontenot.lab8_calebfontenot;
+
+/**
+ *
+ * @author caleb
+ */
+public class Test {
+ Edible getEdible() {
+ Edible e = new Edible() {
+ @Override
+ public String howToEat() {
+ return "Beans: make a soup";
+ }
+ };
+ return e;
+ }
+/*
+Comparable getComparable() {
+ Comparable c = new Comparable() {
+ @Override
+ public int compareTo(Object o) {
+ return == "dummy value" ? ((o.hashCode() == 11 ? 1 : -1) : 0;
+ }
+ };
+ return c;
+ }
+*/
+ public static void main(String[] args)
+ {
+ Edible[] edible = {new Chicken()};
+ }
+}
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/TestEdible.java b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/TestEdible.java
new file mode 100644
index 0000000..19b2ed8
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/TestEdible.java
@@ -0,0 +1,60 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package com.calebfontenot.lab8_calebfontenot;
+
+import java.util.ArrayList;
+
+/**
+ *
+ * @author caleb
+ */
+
+
+public class TestEdible {
+ public static void testWithArrayList() {
+ ArrayList edible = new ArrayList();
+
+ edible.add(new Chicken());
+ edible.add(new Apple());
+ edible.add(new Orange());
+ edible.add(new Duck());
+ edible.add(new Brocoli());
+
+ for (Edible eat: edible) {
+ System.out.println(eat.howToEat());
+ }
+ }
+ public static void testWithArrayOfInterfaces() {
+ Edible[] edible = {
+ new Chicken(), new Apple(), new Orange(), new Duck(), new Brocoli()
+ };
+ for (int i = 0; i < edible.length; ++i) {
+ System.out.println(edible[i].howToEat());
+ }
+ }
+ public static void testWithArrayOfObjects() {
+ Object[] objects = {
+ new Tiger(), new Chicken(), new Apple(), new Duck(), new Brocoli()
+ };
+ for (int i = 0; i < objects.length; ++i) {
+ if (objects[i] instanceof Edible) {
+ System.out.println(((Edible) objects[i]).howToEat());
+ }
+ if (objects[i] instanceof Animal) {
+ System.out.println(((Animal) objects[i]).sound());
+ }
+ }
+ }
+ public static void main(String[] args)
+ {
+ testWithArrayOfObjects();
+ System.out.println("-------------------");
+ testWithArrayOfInterfaces();
+ System.out.println("------------------ ");
+ testWithArrayList();
+ }
+}
+
+
diff --git a/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Tiger.java b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Tiger.java
new file mode 100644
index 0000000..8343568
--- /dev/null
+++ b/Semester 2/Assignments/lab8_CalebFontenot/src/main/java/com/calebfontenot/lab8_calebfontenot/Tiger.java
@@ -0,0 +1,19 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package com.calebfontenot.lab8_calebfontenot;
+
+/**
+ *
+ * @author caleb
+ */
+public class Tiger extends Animal {
+
+ @Override
+ public String sound()
+ {
+ return "Tiger: ROAAAAAAAR!";
+ }
+
+}