You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a class 'Student' with three data members which are roll, name, marks and address. The constructor of the class assigns default values roll as "not assigned", name as "unknown", marks as '0' and address as "not available". It has three methods with the same name 'getData'. First method has two parameters for name and roll and assigns the same whereas the second method has four parameters which are assigned to name, roll, marks and address respectively. Defined another method to print the student details. create three objects and print the details of these student Objects.
Implement the above program using Constructor Overloading.
The text was updated successfully, but these errors were encountered:
Create a class 'Student' with three data members which are roll, name, marks and address. The constructor of the class assigns default values roll as "not assigned", name as "unknown", marks as '0' and address as "not available". It has three methods with the same name 'getData'. First method has two parameters for name and roll and assigns the same whereas the second method has four parameters which are assigned to name, roll, marks and address respectively. Defined another method to print the student details. create three objects and print the details of these student Objects.
Implement the above program using Constructor Overloading.
The text was updated successfully, but these errors were encountered: