forked from SPHS-CS/JavaZoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDolphin.java
More file actions
41 lines (36 loc) · 1002 Bytes
/
Copy pathDolphin.java
File metadata and controls
41 lines (36 loc) · 1002 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* Write a description of class Dolphin here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Dolphin
{
// instance variables - replace the example below with your own
private String description;
private boolean hasBeachBall;
private String name;
/**
* Constructor for objects of class Dolphin
*/
public Dolphin()
{
name = "DolphinRashandala";
hasBeachBall = true;
description = "This is a pink amazon dolphin. Much cool.";
}
public String swim()
{
return "The dolphin swims about all dolphin-like.";
}
public String play()
{
if(hasBeachBall)
return "The dolphin plays with the beachball and is having a splendid day.";
return "The dolphin is depressed at his severe lack of beachball. He shoots lasers.";
}
public String makeNoise()
{
return "EEEEeeeeEEEEeeeeEEEEeeeeEEEEeeeeEEEEeeeeEEEEeeee";
}
}