public static void testArray(int[]a)
{
for(int i:a)
{
if(i==10)
{
System.out.println("Number 10 exists !");
}
}
}
I want to pass parameters to this method without creating variables. I want to call it like so:
testArray({5, 10, 15});
Is this possible?