Guest User

Untitled

a guest
Apr 22nd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1.  
  2. class array {
  3.  
  4.     //Attribute
  5.     int x = 0;
  6.     int zeilen1;
  7.     int[][] arrayListe;
  8.     public static int spalten11;
  9.  
  10.  
  11.     //Konstruktoren
  12.     public array(int spalten, int zeilen)
  13.     {
  14.  
  15.         arrayListe = new int[spalten][zeilen];
  16.         zeilen1 = zeilen;
  17.         spalten11 = spalten;
  18.  
  19.     }
  20.  
  21.     //Methoden auslesen
  22.     public void fuellen()
  23.     {
  24.         for(int ze = 0; ze < zeilen1; ++ze)
  25.         {
  26.             if(x != 3)
  27.             {
  28.                 for(int sp = 0; sp < arrayListe.length; sp++)
  29.                 {
  30.                 arrayListe[ze][sp] = 0;
  31.                 }
  32.             }
  33.             else
  34.             {
  35.                 for(int sp = 0; sp < arrayListe.length; sp++)
  36.                 {
  37.                 arrayListe[ze][sp] = 1;
  38.                 }
  39.  
  40.             }
  41.         }
  42.  
  43.         //return "";
  44.     }
  45.  
  46.     public void ausgeben()
  47.     {
  48.         for(int i = 0; i < arrayListe.length; i++)
  49.         {
  50.             for(int j = 0; j < arrayListe[0].length; j++)
  51.             {
  52.                 System.out.print(arrayListe[i][j]);
  53.                 System.out.print("\t");
  54.             }
  55.             System.out.print("\n");
  56.         }
  57.  
  58.     }
  59.  
  60. }
Add Comment
Please, Sign In to add comment