Question: Tutorial 1 Part 1 : Create a class called Student that has two private data members: ID ( long ) GPA ( double ) .
Tutorial
Part :
Create a class called Student that has two private data members:
ID long
GPA double
Additionally, the class should have:
Two accessor method get for ID and GPA.
One set method for ID and GPA.
A method print to output ID GPA
Write a java program that creates an object called st of type class student then test all the methods in the student class.
Part :
Add to the class the following:
Count: represent number of students static int
A public static method named printCount to print the count of students. Fix the program by increasing the number of students each time you create a new object in the main. Hint: default constructor and use the method printCount to print the count after each object you created.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
