1.12 Homework
Homework
Scenario
Its your first day of class when Mr. Mortenson asks you to identify all the students and list some characteristics about them. Create a class to use as a template to create student objects and create 3 imaginary students.
Instructions
- Create a class
- Instance variables:
String nameint gradeint petsint siblingsMAKE YOUR OWN
- In
main:- Create three student objects.
//Code Here
New Scenario
You find out that one of the students that you created an object for goes by a nickname. Using your knowledge of reference variables, create another object that references back to the same student.
Instructions
-
Use your previous code
-
In
main:- Create a reference variable with a different name that points to the same student.
- Output the instance attributes of this student
//Code Here