it's simpler to declare as following


int[][] ship1= new int[6][6],ship2=new int[6][6];