forschleife abfüllen von arrays und ausgabe


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.