java uses unchecked or unsafe operation
807600Sep 28 2007 — edited Sep 28 2007Anyone can help me take a look at these codes, when i compile it, it shows: \Customer.java uses unchecked or unsafe operations
.........
public int compareTo (Object other){
int result;
result = name.compareTo(((Customer)other).name);
return result;
}
public static void selectionSort (Comparable[] data, int count) {
int min;
for (int index = 0; index < count-1; index++){
min = index;
for (int scan = index+1; scan < count; scan++)
if (data[scan].compareTo(data[min]) < 0)
min = scan;
swap (data, min, index);
}
}
//-----------------------------------------------------------------
// Swaps two elements in the specified array.
//-----------------------------------------------------------------
private static void swap (Comparable[] data, int index1, int index2) {
Comparable temp = data[index1];
data[index1] = data[index2];
data[index2] = temp;
}
..............