Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Zoo/src/main/Runner.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main;

import model.Example;
import model.Wallaby;

public class Runner {

Expand All @@ -13,5 +14,10 @@ private void go() {
Example example = new Example();
example.makeNoise();

Wallaby wallaby = new Wallaby("Bob", 4, "grey");
wallaby.speak();

System.out.println(wallaby.speak());

}
}
62 changes: 62 additions & 0 deletions Zoo/src/model/Wallaby.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package model;

/**
* @author joshtegeler - jmtegeler
* CIS175 - Spring 2024
* Jan 25, 2024
*/

public class Wallaby {

private String name;
private int age;
private String color;

public Wallaby() {
super();
}

// Constructor
public Wallaby(String name, int age, String color) {
this.name = name;
this.age = age;
this.color = color;
}

// Getters/setters
public String getName() {
return name;
}


public void setName(String name) {
this.name = name;
}


public int getAge() {
return age;
}


public void setAge(int age) {
this.age = age;
}


public String getColor() {
return color;
}


public void setColor(String color) {
this.color = color;
}


// Speak method
public String speak() {
return "The " + color + " Wallaby named " + name + " is " + age + " years old and goes 'growllllll'";
}
}