-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuilding.java
More file actions
39 lines (33 loc) · 1023 Bytes
/
Building.java
File metadata and controls
39 lines (33 loc) · 1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
public class Building {
private String code;
private String name;
private String coordinates;
private int floorCount;
// Constructor and initialization
public Building(String code, String name, String coordinates, int floorCount) {
this.code = code;
this.name = name;
this.coordinates = coordinates;
this.floorCount = floorCount;
}
// Getters
public String getCode() {
return code;
}
public String getName() {
return name;
}
public String getCoordinates() {
return coordinates;
}
public int getFloorCount() {
return floorCount;
}
// This is for displaying basic building info; can be overridden
public void displayInfo() {
System.out.println("Building Code: " + code);
System.out.println("Name: " + name);
System.out.println("Coordinates: " + coordinates);
System.out.println("Floors: " + floorCount);
}
}