Question
Create a new class, Student.java that contains private data members: number: is a student number; name: is a string of the student's name, such as
Create a new class, Student.java that contains private data members:
number: is a student number;
name: is a string of the student's name, such as "Alice Wonderland";
dob: is the date of birth;
email: contains the email of the student;
address: the address of the student;
phone: contact phone number;
degree: degree of the student, such as "Bachelor of CS", "Master of IT";
In the file Student.java include:
Initialization constructor that assigns values to all data members;
Public access methods getNumber(), getName(), getDOB(), getEmail(), getAddress(), getPhone() and getDegree() that return values of private data members; Public update methods setNumber(int newNumber), setName(String newName), setDOB(String newDOB), setEmail(String newEmail), setAddress(String newAddress), setPhone(String newPhone) and setDegree(String newDegree) that update values of private data members;
Public overriding method toString() that returns of student information.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
import javautilDate public class Student private int number private String name private Date dob pri...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started