Question: *In Java, Below is my code but when I try to create a seat object and print it status it only shows up as empty.
*In Java,
Below is my code but when I try to create a seat object and print it status it only shows up as empty. As default every seat is empty so i cannot change its state in the Seat class, the changes needs to be maid on the application class, but I don't know how to do this. Please help a desperate soul.
private String sType;
private String sStatus;
private int numS;
public Seat(String type, String status, int num) {
seatType = type;
seatStatus = new String("Empty");
numSeat = num; }
public String getSeatType() {
return seatT; }
public int getSeatNum() {
return numS; }
public String getSeatStatus() {
return seatS; }
public String toString() {
String str = new String();
str+= numS + ", type " +seatT + ", is " + seatS;
return str; }
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
