Please help me what is wrong. It doesn\'t like the compareTo :( please give //no
ID: 642592 • Letter: P
Question
Please help me what is wrong. It doesn't like the compareTo :( please give //notes as too what was wrong so I know for future refrence
___________________________________________________________________
import java.io.*;
import java.util.*;
public class T
{
int position, scan,p=-1;
void bubbleSort(T[] data)
{
for (position=0; position<=data.length -1; position++)
{
if(p+1==position)
{
for (scan=0; scan <= position -1;scan++)
{
if (data[scan].compareTo(data[scan+1])>0)
{
swap(data,scan,scan+1);
p=position;
}
}
}
else
{
println("List is sorted");
System.exit(0);
}
}
}
}