Question: 1. Create an Student class, with instance variables studentId (String), name (String) major(String) 2. Create a constructor that initializes all instance variables. Enforce encapsulation and
1. Create an Student class, with instance variables studentId (String), name (String) major(String) 2. Create a constructor that initializes all instance variables. Enforce encapsulation and create getters and setters for all instance variables. 3. Create a toString() method that prints the contents of the object. 4. In your TestStudent class, create 3 students and store them in a file. 5. Read the students from the file and display their name and major.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
