Write a program to read the element of array using for-each loop?

public class Read
{
                public static void main(String s[])
                {
                                int i[]={50,60,15,-10,3,70};
                                for(int j:i)
                                {
                                                System.out.println("The Element "+j);
                                }
                }
}

JAVA Read.PNG

Advertisements

Comments are closed.

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: