create a JAVA Bean to go with Tic Tac Toe Jsp Developed prog
create a JAVA Bean to go with Tic Tac Toe Jsp Developed program. The bean should encapsalute the board state and should present methods to change the board or get board information. The JSP should create an instance of the bean and use it for all game operations.
Solution
public class TicTacToe implements java.io.Serializable{
private String player1;
private String player2;
private char mark1;
private char mark2;
private int nowplaying;
private int totalPlays;
public TicTacToe(){
}
public int getNowPlaying() {
return nowplaying;
}
public void setNowPlaying(int nowplaying) {
this.nowplaying = nowplaying;
}
public char getMark1() {
return mark1;
}
public void setMark1(char mark1) {
this.mark1 = mark1;
}
public char getMark2() {
return mark2;
}
public void setMark2(char mark2) {
this.mark2 = mark2;
}
public int getTotalPlays() {
return totalPlays;
}
public void setTotalPlays(int totalPlays) {
this.totalPlays = totalPlays;
}
public String getPlayer1() {
return player1;
}
public void setPlayer1(String player1) {
this.player1 = player1;
}
public String getPlayer2() {
return player2;
}
public void setPlayer2(String player2) {
this.player2 = player2;
}
}

