how to pass array in java code example Example: java pass new array to method methodName(new int[]{1, 2, 3}); // Replace int for different types