Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CatTestDrive2 {
- public static void main(String[] args) {
- Cat x = new Cat();
- Cat y = new Cat(2, "Terrance", "brown", true);
- Cat z = new Cat(12, "Kincain", "orange", true);
- // x Cat doesn't have any values yet
- x.setName("Leatle");
- x.setAge(17);
- x.setColor("gray");
- System.out.println(y.getColor() + " " +y.getName());
- System.out.println(x.getColor());
- System.out.println(x.getName());
- System.out.println(x.getAge());
- System.out.println("hello, my name is "+z.getName());
- System.out.println("hello, my name is "+ y.getName());
- y.happyBirthday();
- System.out.println(y.getName() +"-- I'm going to eat now");
- y.eat(3);
- y.setIsHappy(false);
- System.out.print(y.getName() +"----- looking at "+z.getName()+" ");
- y.talk();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement