MCPcopy Create free account
hub / github.com/careercup/ctci / Animal

Class Animal

java/Chapter 3/Question3_7/Animal.java:3–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1package Question3_7;
2
3public abstract class Animal {
4 private int order;
5 protected String name;
6 public Animal(String n) {
7 name = n;
8 }
9
10 public abstract String name();
11
12 public void setOrder(int ord) {
13 order = ord;
14 }
15
16 public int getOrder() {
17 return order;
18 }
19
20 public boolean isOlderThan(Animal a) {
21 return this.order < a.getOrder();
22 }
23}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected