Object Oriented Programming With JavaTU Board 2024
Create a class named college with instance variables cname and crank. Add a method named setCollege with parameters name and rank. Add another method named showRecord to display values of these…
5Create a class named college with instance variables cname and crank. Add a method named setCollege with parameters name and rank. Add another method named showRecord to display values of these variables. Now derive a class named student with member variables name and roll. Also add two methods setStudent and displayRecord to set parameters and to display records respectively in student. Now in main (), declare 4 objects of student and display the records of student whose name ends with "ra".
A worked answer is on its wayMeanwhile, read the Object Oriented Programming With Java notes for this topic.
Discussion
Loading…