Monday, December 29, 2014

Java Tutorial For Beginners 14 - The for Statement in Java (for loops)















1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
package lesson1;
public class MyClass {

 public static void main(String[] args) {
  int[] myintarray = {100,31,26,48,52};
  
  for (int index=0 ; index < 5 ; index++)
  {
   System.out.println(myintarray[index]);
  }
  
  for (int element : myintarray)
  {
   System.out.println(element);
  }
 }

}










Searches related to array java

arraylist java

string array java

array class java

multidimensional array java

array length java

dynamic array java

2d array java

print array java

No comments:

Post a Comment