Skip to content

Example Student class

Example Student class. The student class has four properties namely roll number, name, standard and total marks. All these properties have respective methods to get and set object values.

The student class has two constructors, one is the default, and another one is overloaded to accept all four properties and set them to object properties. Student class also has overridden the toString method from Object class which prints the nice summary when student object is printed.

The student class has been referred to by many of the website examples.

Please let me know your views in the comments section below.

About the author

2 comments

  1. HI kindly help me with this question

    a- Create a class named Student, the class must contain the following:
    1- Variables of the student’s grades
    2- A constructor that will identify these grades
    3- A method that will find the GPA for the students

    b- Create client code to test the classes.
    c- Draw the UML diagram for these two classes

Leave a Reply

Your email address will not be published.