, 내 코드는 컴파일 할 수 없습니다 : Java - 생성자를 찾을 수 없습니까? 컴파일하려고 할 때
package ch02.genericStringLogs;
public class DemoGenericLogs {
public static void main(String[] args) {
GenericLogInterface<Float> genFloatLog = new LinkedGenericLog<Float>();
LLGenericNode<Float> node0 = new LLGenericNode<Float>(2.2);
LLGenericNode<Float> node1 = new LLGenericNode<Float>(3.3);
LLGenericNode<Float> node2 = new LLGenericNode<Float>(4.4);
LLGenericNode<Float> node3 = new LLGenericNode<Float>(5.5);
genFloatLog.insert(node0);
genFloatLog.insert(node1);
genFloatLog.insert(node2);
genFloatLog.insert(node3);
System.out.println(genFloatLog.size());
System.out.println(genFloatLog.toString());
genFloatLog.clear();
System.out.println(genFloatLog.size());
GenericLogInterface<String> genStringLog = new LinkedGenericLog<String>();
LLGenericNode<String> string0 = new LLGenericNode<String>("one");
LLGenericNode<String> string1 = new LLGenericNode<String>("two");
LLGenericNode<String> string2 = new LLGenericNode<String>("three");
LLGenericNode<String> string3 = new LLGenericNode<String>("four");
System.out.println(genStringLog.size());
System.out.println(genStringLog.toString());
genStringLog.clear();
System.out.println(genStringLog.size());
}
}
내가이 오류를 얻을 :
Error:
part1/ch02/genericStringLogs/DemoGenericLogs.java:5: cannot find symbol
symbol : constructor LinkedGenericLog()
location: class ch02.genericStringLogs.LinkedGenericLog<java.lang.Float>
다음과 같이 : LinkedGenericLog 클래스에 대한 인수 생성자를 찾을 수 없습니다 ... 그리고 그 클래스를 표시하지 않으므로 더 많은 것을 말하기는 어렵습니다. – assylias
'LinkedGenericLog' 클래스가 있습니까? 같은 패키지에 수업이 있나요? –
예. 여기에 나열된 파일과 동일합니다. http://stackoverflow.com/questions/15122613/java-compile-time-error-compiler-not-recognizing-method-override – user1696035