Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise 0 1 : a - Create a class Student that has the following private data: ID ( int ) , name ( String )
Exercise:
a Create a class Student that has the following private data: ID int name String gpa double
b Add a constructor that has no arguments, it initialize the data to zero for id and gpa, and null for the name.
c Add a constructor that receives three arguments that initialize the data of the class.
d Add setter getter methods.
e Create another class called "Test" that has main method, and create two objects of class Student using each one of the constructors.
f Print each one of the objects you created.
What is the output?
g If you want to print the data of each object, when object is printed? What should you do
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started