Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 0 1 : a - Create a class Student that has the following private data: ID ( int ) , name ( String )

Exercise01:
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?
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

What's the most relaxing part of your day?

Answered: 1 week ago

Question

differentiate the function ( x + 1 ) / ( x ^ 3 + x - 6 )

Answered: 1 week ago