Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. public class Cat{
  2.   public String color = "White";
  3.   public String action = "sitting";
  4.   public Cat(){}
  5.   public Cat(String c,String a){
  6.     color = c;
  7.     action = a;
  8.   }
  9.   public Cat(String c){
  10.     color = c;}
  11.  
  12.   public void changeColor(String c){
  13.     this.color=c;
  14.    
  15.   }
  16.  
  17.   public void printCat(){
  18.     System.out.println(this.color+" cat is "+this.action);
  19.   } }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement