Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The goal of this assignment is to implement a simple class. You will see how objects (as instances of a class) store their data, and
The goal of this assignment is to implement a simple class. You will see how objects (as instances of a class) store their data, and how methods access the data of an object. 1-Write a program with two classes, one main class called StudentTester with a main method, and another class called Student with the following specifications: 2-The student class should have these instant variables: name (String), id (integer) 3-The Student class should have the following methods: -a void method called setName that receives a String as input argument and assigns it to the name variable of that object. -a method called get name with no input argument which return the name of the student. 4-The Student Tester class should have a main method. From the main method create two student objects called student1 and student2.-Set a name for each student and add some courses for each.-Then with two separate print statements print out the name and enrolled courses for each student. A sample output should looks like this: Student1
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