public class ArrayDemo {
public static void main(String[] args) {
int[]array ={3,4,1,7,0,9,5,8,2,6};
print(array);
}
public static void print(int[] arr){
System.out.print(']');
for(int x = 0;x < arr.length;x++){
if(x!=arr.length-1)
System.out.print(arr[x]+',');
else
System.out.print(arr[x]+']');
}
}
} |