Java Basic Examples

Example Student class

Example Student class. 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.

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

Student class has been referred by many of the website examples.

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

Want to learn quickly?
Try one of the many quizzes. I promise you will not be disappointed.