Question: Given a Student class, create a class with following characteristics The class name should be ClassRoom . Private variable students to maintain the list of

Given a Student class, create a class with following characteristics

  • The class name should be ClassRoom.
  • Private variable students to maintain the list of Student objects.
  • Function addStudent with input parameter name (string) and rollNo(int) adds a new student in students list.
  • Method getAllStudents should return all the students in ClassRoom.

Input Jack

1

Jones

2

Marry

3

where,

  • First & Second line represent a students name and roll number. And so on.

Output

1 - Jack

2 - Jones

3 - Marry

Assume that,

  • Maximum students count can be 10.

(Use Java to work on this question please).

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!