this is not a homework assignment. I am just practicing to improve my skill. This question has been answered before, but I am confused. If someone could explain me step by step then I would be able to understand better. I do not want to copy and paste. I want to learn and my professor never taught me how to remove the last comma from the list. Thank you for your help and support.
public static void print(int[] list){
System.out.print("[ ");
for(int i = 0; i < list.length; i++){
System.out.print(list[i]);
for(int j = 0; j <1; j++){
System.out.print(",");
}
}
System.out.print("]");
}