package com.company;
public class CartoonCharacter {
private String Name;
private String catchPhrase;
public CartoonCharacter() {}
public String GetName() {
return Name;
}
public String getCatchPhrase() {
return catchPhrase;
}
public void setName(String newName) {
Name = newName;
}
public void setCatchPhrase(String newcatchPhrase) {
catchPhrase = newcatchPhrase;
}
public void sayCatchPhrase() {
System.out.println(this.Name + " says " + this.catchPhrase);
}
}
}
package com.company;
public class CartoonApp {
public static void main(String[] args) {
CartoonCharacter oneCharacter = new CartoonCharacter();
oneCharacter.setName("Bart Simpson");
oneCharacter.setCatchPhrase("Eat my shorts!");
oneCharacter.sayCatchPhrase();
}
CartoonCharacter twoCharacter = new CartoonCharacter();
twoCharacter.setName("Yogi Bear");
twoCharacter.setCatchPhrase("I'm smarter that the average bear!");
twoCharacter.sayCatchPhrase();
CartoonCharacter threeCharacter = new CartoonCharacter();
threeCharacter.setName("Buzz Lightyear");
threeCharacter.setCatchPhrase("To infinity and beyond!");
threeCharacter.sayCatchPhrase();
CartoonCharacter fourCharacter = new CartoonCharacter();
fourCharacter.setName("Tweety Pie");
fourCharacter.setCatchPhrase("I tought I saw a puddy tat!");
fourCharacter.sayCatchPhrase();
}