Untitled
public class Classroom { private int classroomNumber; private String classroomName; private String classroomLocation; //instance var public Classroom(int classroomNumber, String classroomName, String classroomLocation) { this.classroomNumber = classroomNumber; this.classroomName = classroomName; this.classroomLocation = classroomLocation; } //constructor public int getClassroomNumber() { return classroomNumber; } public String getClassroomName() { return classroomName; } public String getClassroomLocation() { return classroomLocation; } public void setClassroomNumber(int classroomNumber) { this.classroomNumber = classroomNumber; } public void setClassroomName(String classroomName) { this.classroomName = classroomName; } public void setClassroomLocation(String classroomLocation) { this.classroomLocation = classroomLocation; } public String toString() { return "Classroom Number: " + classroomNumber + " Classroom Name: " + classroomName + " Classroom Location: " + classroomLocation; } }
Leave a Comment