-1
public void sort(){
Node sortedList = null;
while(sortedList != null){
Node current = sortedList;
sortedList = sortedList.next;
Node x;
Node previous = null;
for(x = sortedList; x != null; x = x.next){
if(current.value < x.value){
break;
}
previous = x;
}
if(previous == null){
current.next = sortedList;
sortedList = current;
}
else{
current.next = previous.next;
previous.next = current;
}
return sortedList;
}}}
这是错误消息:如何在Java中解决“错误:找不到符号”?
LinkedList.java:352: error: cannot find symbol
if(current.value < x.value){
^
symbol: variable value
location: variable current of type `LinkedList.Node`
这是错误消息LinkedList.java:352:错误:找不到符号 如果(current.value
user6157611
它的可变电流似乎没有变量,名称值在类中可访问节点 – Stultuske
告诉我们“节点”的定义 –