Question: public class Student ( private double gpa; private String studentName; public Student()); public void setgpa(double 1) (gpa=1;} public double getgpa() {return gpa;) public void setnane(String

 public class Student ( private double gpa; private String studentName; public

public class Student ( private double gpa; private String studentName; public Student()); public void setgpa(double 1) (gpa=1;} public double getgpa() {return gpa;) public void setnane(String n) (studentName=n;} public String getname() {return studentane; } public class School { private String name; public School public School(String n) {name = n;} public void setName(String n) {name = n;} public String getName() { return name;) public class ssclient public static void main(String [] args) { School schooli new School(); schooli.setName("MCC"); Systen.out.println("School Nane: " + school1.getName()); Student studenti new Student(); studenti. setname ("George Boole"); studenti. setgpa(3.53); System.out.println("Name: " + student1.getrane()); System.out.println("Your GPA: + studenti.getgpa()); Answer the following questions: 1. What are the NAME and TYPE of the objects instantiated here. 2. What are the names of instance variables in each class? 3. Why do we instantiate/create objects? 4. What are the name(s) of the constructors here? How many do you see? 5. What do the constructor methods do? 6. If a class has 3 instance variables what is the minimum number of sethods in that class

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!