如何使用Sextet构造Septet
每个元组都有 add() 和 addAtX() 方法来转换元组。
package cn.xnip;
import org.javatuples.Septet;
import org.javatuples.Sextet;
public class TupleTester {
public static void main(String args[]){
Sextet<Integer, Integer, Integer, Integer, Integer, Integer> sextet
= Sextet.with(5,6,7,8,9,10);
System.out.println(sextet);
Septet<Integer, Integer, Integer, Integer, Integer, Integer, String>
septet = sextet.add("test");
Septet<String, Integer, Integer, Integer, Integer, Integer, Integer>
septet1 = sextet.addAt0("test");
System.out.println(septet);
System.out.println(septet1);
}
}
输出结果为: