草庐IT

java - 通用方法 - "unchecked conversion to conform to T from the type"警告

如果我有以下内容:publicinterfaceFoo{TgetBlah();}publicclassBarimplementsFoo{publicBargetBlah(){returnthis;}}我在Eclipse中收到有关Bar类中“getBlah”实现的警告:-Typesafety:ThereturntypeBarforgetBlahfromthetypeBarneedsuncheckedconversiontoconformtoTfromthetypeFoo我该如何解决这个问题?为什么我会收到警告?谢谢 最佳答案 您正在覆