Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Cat {
- String name = "Gosho"; //suzdavame pole s ime
- String color = "Black"; //suzdavame pole s cvqt
- int age = 3; //suzdavame pole s godini
- public Cat() { //default constructor
- this.name = name;
- this.color = color;
- this.age = age;
- }
- public Cat(String name, String color, int age) { //constructor with parameters
- this.name = name;
- this.color = color;
- this.age = age;
- }
- public void CatEating(){ //method pokazvasht che kotkata qde
- System.out.println("The cat is eating!");
- }
- public void CatSleeping(){ //method pokazvasht che kotkata spi
- System.out.println("The cat is sleeping!");
- }
- public void LionEating(){ //method pokazvasht che luva qde
- System.out.println("The lion is eating!");
- }
- public void LionSleeping(){ //method pokazvasht che luva spi
- System.out.println("The lion is sleeping!");
- }
- }
Add Comment
Please, Sign In to add comment