How to read Array using For loop


public class OpenFile {
    public static void main(String args[]) {
        int arr[] = new int[5];

        for (int i = 0; i < arr.length; i++) {
            arr[i] = i;
            System.out.println(arr[i]);
        }
    }
}

outpu:

0
1
2
3
4

Comments

Popular posts from this blog

How to check if two Strings are anagrams of each other?

Multimedia search engine using python

How to sort String array by length of each string present in an array