Question: In the following code: public class Dog { int ageMonths; //Age of dog in months public void increaseMonth () { int years; ageMonths = ageMonths

 In the following code: public class Dog \{ int ageMonths; //Age

In the following code: public class Dog \{ int ageMonths; //Age of dog in months public void increaseMonth () \{ int years; ageMonths = ageMonths +12; years=ageMonths/12; \} public static void main(String[] args) \{ Dog mjDog = new Dog (); myDog.increaseMonth(); myDog. increaseMonth(); System.out.print("My dog is about " + myDog.ageMonths/12 + " years old"); \} \} Which one is an attribute/member variable of the class Dog? agemonths ageMonths years myDog

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!