Thursday, April 5, 2018

Array output in Java code

/* Example of Array Output */
package ArrayOutput;
public class ArrayOutput
{
    public static void main(String[] args)
    {
        int marks[] = {23, 54, 34, 10, 15, 30, 25};
        for(int i = 0; i <= 6; i++)
        {
            prln("Mark["+i+"] = "+marks[i]);
        }
    }
    static void prln(Object anyObject)
    {
        System.out.println(anyObject);
    }
    static void pr(Object anyObject)
    {
        System.out.print(anyObject);
    }
   
}















Share:

0 comments:

Post a Comment

Blogger templates