I have a few questions:
for this function I can't seem to get rid of the comma that is produced at the end of the array no matter what I do:
public static void printArray(int arr)
for (int i=0; i<arr.length; i++)
System.out.print(arr[i] + ", ");
and I need to write a function that checks whether an array has any duplicate numbers in it or not. And it should return true if and only if the input array has any duplicate numbers. But i have no clue how to do this. can someone help?
If anyone could help that would be great, I'm sorry if they are ridiculous questions but I am relatively new to java programming. thanks.