Can we replace 1-dimensional array with var-arg parameter?

class VarArgMethod8
{
public static void main(String... args)
{
System.out.println("var-arg parameter used in main method");
}
}
/*
Output:- var-arg parameter used in main method
Explanation:- Yes, Wherever 1-dimensional is present we can replace with var-arg parameter but
wherever var-arg parameter is present we cannot replace with 1-D array.

*/

0 comments: