You are here: Home / Topics / Simple static Array example in Java

Simple static Array example in Java

Filed under: Java on 2023-08-19 18:36:19

// Simple static array

public class SimpleArray
{
   public static void main(String[] args) 
   {
       int a[]={10,20,30,40,50};
       for(int i=0;i<5;i++)
       {
           System.out.println(a[i]);
       }
   }
}


Output:

10
20
30 
40
50


About Author:
Y
Yatendra Sir     View Profile
Hi, I am using MCQ Buddy. I love to share content on this website.