Question
IN JAVA Create a student class Create static fields classNumber, className, instructor Create instance fields studentId, firstname, lastname, address, city, state, email, etc. Make all
IN JAVA
Create a student class
Create static fields classNumber, className, instructor
Create instance fields studentId, firstname, lastname, address, city, state, email, etc.
Make all fields private
Create getter and setter methods for the static fields
Create getter and setter methods for the instance fields
Create a constructor for the class that takes student firstname and lastname Constructor should generate a sequential student id (ids should start with 1000 and increment for each new student)
Create a second constructor that takes all fields (firstname, lastname, address, city, etc.) Constructor should call the first constructor to initialize firstname and lastname, and create the next student id.
Create a toString( ) string method for the class toString( ) method should output all fields, including studentId, name, instructor, className, etc.
Create a second class that will test the student class
Instantiate at least 5 objects of the student class using both the small and large constructors
Print out the 5 objects using the toString( ) method
Call getters and setters to alter some student information (e.g. firstname, address, etc.)
reprint the 5 objects
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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