英文:
How to solve error ""cannot instantiate the type Triple""
问题
我尝试使用三元组来返回多个值,但出现了“无法实例化类型Triple”的错误。我尝试了多种方法,但都没有成功。正确的语法是什么?
import org.apache.commons.lang3.tuple.Triple;
private static Triple<String, String, String> test() {
Triple<String, String, String> triple = Triple.of(null, null, null);
// ...
return triple;
}
英文:
I'm trying to use a triple to return multiple values but I get "cannot instantiate the type Triple" I tried multiple things but nothing worked. What is the correct Syntax?
import org.apache.commons.lang3.tuple.Triple;
private static Triple<String, String, String> test() {
Triple<String, String, String> triple = new Triple<>();
...
return triple;
}
答案1
得分: 5
Triple是抽象的,请使用MutableTriple或ImmutableTriple代替。
英文:
Triple is abstract, use MutableTriple or ImmutableTriple instead.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论