Classroom
Classroom
import java.util.*;
/**
* Abstraction
*
*
*/
public class Class
{
/**
* CLASS is the collection of students
*/
int std;
char sec;
Student [] students;
String teacher;
int strength;
int max_seats;
/**
* Constructor method is called only once in one object
* It helps in creating an object
* Constructor methos has the name of the class
* Methods don't have any output / return type
* Functions are different by the type of formal parameter
*/
//Parameterised constructor
public Class(int std)
{
this.std = std;
}
//Parameterised constructor
public Class (char sec)
{
this.sec = sec;
}
//This function sets the data for each student in a given class
void read_class_data()
{
int n = 0;
strength = n;
for(int i = 0; i<n;i+=1)
{
students[i] = new Student();
students[i].setData();
students[i].setAdmn_no();
File: Untitled Document 1 Page 2 of 2
}
}