Question: / / Class Declaration public class Dog { / / Instance or Formal Variables String breed; String size; int age; String color; / / method

// Class Declaration public class Dog {
// Instance or Formal Variables
String breed;
String size;
int age;
String color;
// method 1
public String getInfo(){
return ("Breed is: "+breed+" Size is:"+size+" Age is:"+age+" color is: "+color);
}
public static void main(String[] args){ Dog bullDog = new Dog(); bullDog.breed="Maltese"; bullDog.size="Small";
bullDog.age=2;
bullDog.color="white"; System.out.println(bullDog.getInfo());
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!