Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Dog {
- String color="black";
- int height;
- int weight;
- static String type="sheera";
- public Dog(int height, String color) {
- this.height = height;
- this.color = color;
- System.out.println("creating a new dog");
- }
- public void bark() {
- System.out.println("barking buh buh");
- }
- public void me() {
- System.out.println("my color is " + this.color + " and my height is " + this.height);
- }
- public void jump() {
- System.out.println("JUMPING");
- }
- public void myType(){
- System.out.println("my type is "+this.type);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment