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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!