Sunday, February 25, 2018

Java program : Array as Argument

class ArrayAsArgument
{   
    static void m1(int a[])
    {
          for(int i=0;i<a.length;i++)
          {
            System.out.println(a[i]);
          }
    }
    public static void main(String[] args)
    {
        int a[]={1,2,3,4,5,6,7,8,9,10};
        m1(a);
    }

}

Thanks
Happy programming

No comments:

Post a Comment

How can I run a C++ program directly from Windows?

How-can-I-run-a-C-program-directly-from-Windows