Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ForLoopExample {
- public static void main(String args[]){
- int arr[]={2,11,45,9};
- //i starts with 0 as array index starts with 0 too
- for(int i=0; i<arr.length; i++){ //i<arr.length;=azonósítóval hivatkozunk fügvényre (lenght=tömb hossz) (length sintax keresés leírja a pontos felhasználást)
- System.out.println(arr[i]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment