public class Dog
extends java.lang.Object
Dog class. Represents the basics of a Dog and related methods
-
Field Summary
Fields
Modifier and Type |
Field |
Description |
(package private) int |
age |
age as an int
|
(package private) java.lang.String |
breed |
breed of Dog
|
(package private) java.lang.String |
name |
name of Dog as a String
|
(package private) java.lang.String |
owner |
owner's name
|
-
Constructor Summary
Constructors
Constructor |
Description |
Dog() |
default constructor initiallizes variables to dummy values
|
Dog(java.lang.String n,
java.lang.String o,
int a,
java.lang.String b) |
constructor that takes in initial values for following class variables
|
-
Method Summary
Modifier and Type |
Method |
Description |
(package private) java.lang.String |
getName() |
getter for name of Dog
|
(package private) void |
setName(java.lang.String n) |
setter for name of Dog
|
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
java.lang.String name
name of Dog as a String
-
java.lang.String owner
owner's name
-
-
java.lang.String breed
breed of Dog
-
Constructor Details
-
Dog()
default constructor initiallizes variables to dummy values
-
Dog(java.lang.String n,
java.lang.String o,
int a,
java.lang.String b)
constructor that takes in initial values for following class variables
- Parameters:
n
- Dog's name
o
- Dog's owner's name
a
- Dog's age as an int
b
- Dog's breed
-
Method Details
-
java.lang.String getName()
getter for name of Dog
- Returns:
- the name as a String
-
void setName(java.lang.String n)
setter for name of Dog
- Parameters:
n
- name to be stored