Question
java Implement a Person class with the following characteristics: Two private instance variables, both Strings. One variable will store the name of the Person, the
java
Implement a Person class with the following characteristics:
Two private instance variables, both Strings. One variable will store the name of the Person, the other will store the student number.
One constructor that requires two Strings as input, and uses them to initialize the instance variables.
Set and get methods for both private instance variables.
A print method that, when called, prints both the name and student number to the screen.
In your main method, create an instance of your Person class and initialize it with your name and student number. Call the print method to print your information to the screen.
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