public class Dog
{
public
String breed;
public
String name;
public int age;
public void bark()
{
System.out.println(name + "
is barking.");
}
public void eat()
{
System.out.println(name + "
is eating.");
}
public void sleep()
{
System.out.println(name + "
is sleeping.");
}
public void fetch()
{
System.out.println(name + "
is fetching.");
}
}
|