Question: Given a class called Person, as specified below. Also imagine there is a Person object called person1,created in a client class. Which of the statement

 Given a class called Person, as specified below. Also imagine there

Given a class called Person, as specified below. Also imagine there is a Person object called person1,created in a client class. Which of the statement will print the values of instance variables, name and age, of person1 in the client class? Code for class Person is as follows: ublic class Person private String name; private int age; public int getAge) [ return age; ) pubic void setAgelint age)this.age- age:] public void printAge0l System.out.println("Name is:" +person1.getName)+ "age is:" +person1.getAge) ): person1.printAge0: System.out.println( getAge0 ); person1.getAge0: System.out.println(" Name is:" +name+ "age is:"age ); System.out.printin(" age is:"person1.age)

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!