在最终类

时间:2018-05-16 20:30:52

标签: java generics comparable

我尝试扩展Comparable<>在我的最后一堂课中,但我不知道为什么会出现这个错误。

public final class Identifier extends Comparable<Identifier> {

...

}

错误:Comparable类型不能是Identifier的超类;超类必须是一个类

但是不是可比较的一类?我不明白。

感谢您的帮助

1 个答案:

答案 0 :(得分:2)

不,它是一个界面。您实现接口,不要扩展它们。你需要

Error while importing sbt project:

Getting org.fusesource.jansi jansi 1.11  (this may take some time)...

:: problems summary ::
:::: WARNINGS
module not found: org.fusesource.jansi#jansi;1.11

==== local: tried

C:\Users\user_name\.ivy2\local\org.fusesource.jansi\jansi\1.11\ivys\ivy.xml

-- artifact org.fusesource.jansi#jansi;1.11!jansi.jar:

C:\Users\user_name\.ivy2\local\org.fusesource.jansi\jansi\1.11\jars\jansi.jar

==== local-preloaded-ivy: tried

file:/C:/Users/user_name/.sbt/preloaded/org.fusesource.jansi/jansi/1.11/ivys/ivy.xml

==== local-preloaded: tried

file:/C:/Users/user_name/.sbt/preloaded/org/fusesource/jansi/jansi/1.11/jansi-1.11.pom

-- artifact org.fusesource.jansi#jansi;1.11!jansi.jar:

file:/C:/Users/user_name/.sbt/preloaded/org/fusesource/jansi/jansi/1.11/jansi-1.11.jar

==== Maven Central: tried

https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/jansi-1.11.pom

-- artifact org.fusesource.jansi#jansi;1.11!jansi.jar:

https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/jansi-1.11.jar

==== sbt-maven-releases: tried

https://repo.scala-sbt.org/scalasbt/maven-    releases/org/fusesource/jansi/jansi/1.11/jansi-1.11.pom

-- artifact org.fusesource.jansi#jansi;1.11!jansi.jar:

https://repo.scala-sbt.org/scalasbt/maven-    releases/org/fusesource/jansi/jansi/1.11/jansi-1.11.jar

==== sbt-maven-snapshots: tried

https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/fusesource/jansi/jansi/1.11/jansi-1.11.pom

-- artifact org.fusesource.jansi#jansi;1.11!jansi.jar:

https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/fusesource/jansi/jansi/1.11/jansi-1.11.jar

==== typesafe-ivy-releases: tried

https://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.jansi/jansi/1.11/ivys/ivy.xml

==== sbt-ivy-snapshots: tried

https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.fusesource.jansi/jansi/1.11/ivys/ivy.xml

::::::::::::::::::::::::::::::::::::::::::::::

::          UNRESOLVED DEPENDENCIES         ::

::::::::::::::::::::::::::::::::::::::::::::::

:: org.fusesource.jansi#jansi;1.11: not found

::::::::::::::::::::::::::::::::::::::::::::::


:::: ERRORS

Server access Error: sun.security.validator.ValidatorException: PKIX path     building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target url=https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/jansi-1.11.pom

Server access Error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target url=https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/jansi-1.11.jar

Server access Error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target url=https://repo.scala-sbt.org/scalasbt/maven-releases/org/fusesource/jansi/jansi/1.11/jansi-1.11.pom

Server access Error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target url=https://repo.scala-sbt.org/scalasbt/maven-releases/org/fusesource/jansi/jansi/1.11/jansi-1.11.jar

Server access Error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target url=https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/fusesource/jansi/jansi/1.11/jansi-1.11.pom

Server access Error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target url=https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/fusesource/jansi/jansi/1.11/jansi-1.11.jar

Server access Error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target url=https://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.jansi/jansi/1.11/ivys/ivy.xml

Server access Error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target url=https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.fusesource.jansi/jansi/1.11/ivys/ivy.xml


:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
Error during sbt execution: Error retrieving required libraries
unresolved dependency: org.fusesource.jansi#jansi;1.11: not found
(see C:\Users\user_name\.sbt\boot\update.log for complete log)
Error: Could not retrieve jansi 1.11`