Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

class Student { private String name; private String ID; Private int marks; Student( ) { } Student (String name, String ID) { this.name = name;

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions