编程语言
首页 > 编程语言> > Java 临时变量的使用

Java 临时变量的使用

作者:互联网

   import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.ImmutableTriple;

// 返回两个字段
ImmutablePair<Integer, String> pair = ImmutablePair.of(1, "yideng");
System.out.println(pair.getLeft() + "," + pair.getRight()); // 输出 1,yideng
// 返回三个字段
ImmutableTriple<Integer, String, Date> triple = ImmutableTriple.of(1, "yideng", new Date());
System.out.println(triple.getLeft() + "," + triple.getMiddle() + "," + triple.getRight()); // 输出 1,yideng,Wed Apr 07 23:30:00 CST 2021

标签:Java,变量,临时,getRight,ImmutablePair,ImmutableTriple,yideng,triple,pair
来源: https://www.cnblogs.com/zhaojiu/p/14930321.html