Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1. public class Square{
  2.   byte rank,move;
  3.   boolean who;
  4.   public void returnAll(){
  5.     getRank();
  6.     getMove();
  7.     getWho();
  8.   }
  9.   public byte getRank(){
  10.     return rank;}
  11.   public byte getMove(){
  12.     return move;}
  13.   public boolean getWho(){
  14.     return who;}
  15.   private byte setRank(byte r){
  16.     return rank=r;}
  17.   private byte setMove(byte m){
  18.     return move=m;}
  19.   private boolean setWho(boolean w){
  20.     return who=w;}
  21.   public void setAll(byte r1, byte m1, boolean w1){
  22.     setRank(r1);
  23.     setMove(m1);
  24.     setWho(w1);
  25.   }
  26. }
  27. public class Board{
  28.   public static void main(String[] args){
  29.   Square[][] board = new Square[10][10];
  30.   board[0][0].setAll((byte)2,(byte)1,false);
  31.   System.out.println(board[0][0].getRank());
  32.   }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement