Answered step by step
Verified Expert Solution
Question
1 Approved Answer
class Student { private String name; private String ID; Private int marks; Student( ) { } Student (String name, String ID) { this.name = name;
class Student \{ private String name; private String ID; Private int marks; Student( ) \{ \} Student (String name, String ID) \{ this.name = name; this.ID = ID; \} Public void setMarks (int marks) \{ this.marks = marks; \} Public void display () \{ System.out.println("Student name: "+ name); System.out.println("Student ID: "+ ID); System.out.println("'Student marks: "+ marks); \} Define class Student as given above and use it to complete the following parts: - Create array with size 2 and add two objects of Student using parameterized constructor (constructor with argument).. - Set the objects marks using defined setMarks method. - Print out the objects using defined display method
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