- Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathZoo.java
More file actions
Latest commit
26 lines (19 loc) · 764 Bytes
/
Copy pathZoo.java
File metadata and controls
26 lines (19 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
publicclassZoo {
publicstaticvoidmain(String[] args) {
DogFido = newDog(8);
DogSpark = newDog();
Fido.speak();
Spark.speak();
System.out.println("Fido's age is : " + Fido.age);
System.out.println("Spark's age is : " + Spark.age);
DuckDaffy = newDuck(10);
System.out.print("Daffy says hi or should I say: ");
Daffy.speak();
System.out.println("Daffy's age is : " + Daffy.age);
System.out.println("Daffy swims at " + Daffy.nauticalspeed + " knots.");
System.out.println("Daffy flies at " + Daffy.flightspeed + " knots.");
HumanShijit = newHuman();
System.out.println("Shijit's Birthdate is" + Shijit.getDateofBirth());
System.out.println("Shijit's SSN is" + Shijit.getSSN());
}
}