Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. import java.util.ArrayList;
  2.  
  3.  
  4. public class test {
  5.    
  6.    
  7.     public static void main (String[]args){
  8.        
  9.        
  10.         boolean[][] BoolFeld = new boolean [4][4];
  11.        
  12.        
  13.         for (int i=0; i<BoolFeld.length; i++)
  14.         {
  15.                 for (int j=1; j<BoolFeld[i].length; j++)
  16.                 {
  17.                         if(j%2!=0)
  18.                         {
  19.                             System.out.println("current j:"+j);
  20.                         BoolFeld[i][j]=true;
  21.                        
  22.                         }
  23.  
  24.                 }
  25.                
  26.          }
  27.        
  28.         for (int i = 0; i < BoolFeld.length; i++){
  29.             for(int j = 0; j < BoolFeld[0].length; j++){
  30.             System.out.print(BoolFeld[i][j]+"|");
  31.             }
  32.             System.out.println();
  33.         }
  34.        
  35.     }
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement