Where:
Student
-name:String
-gpa:float
+Student()
+Student(rollNo:String, name:String, gpa:float)
+Setters and Getters of all fields
+toString():String
Student() default constructor
Student(rollNo: String, name: String, gpa: float) - parameterized constructor sets values to all fields in the object: rollNo, name and gpa.
getRollNo():String - return rollNo in uppercase
toString(): String- return a string that contains all the information of the Student:rollNo-name-gpa. The rollNo in uppercase and gpa is formatted two decimal places
-Create a StudentList class extending from HashMap<Key, Value> class in Java collection (with Key:will be used to store rollNo of student and Value store student object).
StudentList
Where:
Zoom
+ 90%
Close