write java code usingClasses and Objects for the following quations: 1. Create a new Java class named Student that has the following fields o yearOfAdmission - The yearOfAdmission field is an calendar data type that holds the year of admitting the student (e.g. 2021) o Name - The name field is a String object that holds the name of the student (e.g. “Ahlam") o Marks – The marks field is a integer that holds the total marks of the student scored out of 500(e.g. 399) 2. In addition to that, the student class should have the following methods. o Constructor - The constructor should accept yearOfAdmission, name, and marks as arguments These values should be used to initialize the year of admitting student, name of the student, and marks fields. o Getter Methods - Write three accessor (getter) methods to get the values stored in an object's fields getYear(), getName(), getMarks() o Update() method to change the name of the student by passing studentID as an argument to the method. Below code is a hint to get you started.
write java code usingClasses and Objects for the following quations:
1. Create a new Java class named Student that has the following fields
o yearOfAdmission - The yearOfAdmission field is an calendar data type that
holds the year of admitting the student (e.g. 2021)
o Name - The name field is a String object that holds the name of the student
(e.g. “Ahlam")
o Marks – The marks field is a integer that holds the total marks of the student
scored out of 500(e.g. 399)
2. In addition to that, the student class should have the following methods.
o Constructor - The constructor should accept yearOfAdmission, name, and
marks as arguments
These values should be used to initialize the year of admitting student,
name of the student, and marks fields.
o Getter Methods - Write three accessor (getter) methods to get the values stored
in an object's fields
getYear(), getName(), getMarks()
o Update() method to change the name of the student by passing studentID as an
argument to the method.
Below code is a hint to get you started.
Step by step
Solved in 3 steps with 1 images