CSE-8B / PA3 / Starter / Test.java
Test.java
Raw
public class Test{
  int[][] data ={
  {0,1,2,3,4,5},
  {1,2,3,4,5,6},
  {2,3,4,5,6,7},
  {3,4,5,6,7,8},
};

  public static void main(String[] args) {
    int[][] data ={
    {0,1,2,3,4,5},
    {1,2,3,4,5,6},
    {2,3,4,5,6,7},
    {3,4,5,6,7,8},
  };
    System.out.println(data[2][4]);
    System.out.println(data[0][5]);
    foo(data[1]);
    System.out.println("the number of cols of the array is " + data[3].length);
    System.out.println("The number of rows of the array is "+ data.length);
    System.out.println((char)('A'+ 2));
    System.out.println("A" + 2);
  }

  public static void foo(int[] a){
    for(int x : a){
      if(x > 5){
        System.out.println("5");
        return;
      }
      else{
        System.out.println("6");
        return;
      }
    }
  }

}