+ 1
Passing an array as an argument
Let's say that I need to pass an array in Java as an argument is it necessary for me to create objects for it or can I use the primitive methods to do the same?
2 Respuestas
+ 5
You have to create an object, can't think of another way.
But you can create it anonymous when you call the method, like:
method(new String[] {"john", "james"});
+ 1
in java you can pass the array with refrence