Posted By

dejot on 07/14/12


Tagged


Versions (?)

forschleife abfüllen von arrays und ausgabe


 / Published in: Java
 

  1.  
  2. public class HelloWorld {
  3.  
  4. public static void main(String... args) {
  5. int[] a = new int[6];
  6. int zaehler = 0;
  7.  
  8. for (int i = 0; i < a.length; i++ ) {
  9. a[i] = ++zaehler;
  10.  
  11. }
  12. for (int i = 0; i < a.length; i++) {
  13. int c = a[i];
  14. System.out.println(c);
  15. }
  16.  
  17.  
  18.  
  19. }
  20.  
  21. }
  22.  

Report this snippet  

You need to login to post a comment.