Question: Using the program in Programming below, add comments to the lines that print your full name, major and c lassification. After you make your changes,

Using the program in Programming below, add comments to the lines that print your full name, major and c lassification. After you make your changes, execute the program and verify the contents of the output. Download the pro gram and save it to your computer public class Puppy int puppyAge: public Puppy(String name) { 1/ This constructor has one parameter, name. System.out.println("Name chosen is :" + name); } public void setAge(int age) { puppyAge = age; } public int getAge() { System.out.println("Puppy's age is :" + puppyAge ); return puppyAge:} public static void main(String [largs) { * Object creation */ Puppy myPuppy = new Puppy( "tommy" ); * Call class method to set puppy's age mypuppy.setAge( 2 ): * Call another class method to get puppy's age mypuppy.getAge: * You can access instance variable as follows as well System.out.println("Variable Value t.myPuppy-puppyAge )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
