JavaTuples中Septet类的contains()方法
该contains()方法用于搜索Septet类中的值。
首先让我们看看使用JavaTuples所需的工具。要在JavaTuples中使用Septet类,您需要导入以下包-
import org.javatuples.Septet;
注-下载和运行JavaTuples程序的步骤如果您正在使用EclipseIDE在JavaTuples中运行Septet类,则右键单击Project→Properties→JavaBuildPath→AddExternalJars并上传下载的JavaTuplesjar文件。
以下是一个例子-
示例
import org.javatuples.Septet;
public class Demo {
public static void main(String[] args) {
Septet < String, String, String, String, String, String, String > s = Septet.with("Jack", "Sam", "Tom", "Kate", "David", "Kevin", "Angelina");
System.out.println(s);
boolean res = s.contains("David");
System.out.println("Does value exists in Septet class? = " + res);
}
}输出结果
[Jack, Sam, Tom, Kate, David, Kevin, Angelina] Does value exist in Septet class? = true
热门推荐
6 保研的祝福语简短
10 年轻20岁祝福语简短
11 朋友结婚祝福语信息简短
12 女孩婚礼贺卡祝福语简短
13 30段点歌简短祝福语
14 虎年春节祝福语图文简短
15 写给后妈祝福语大全简短
16 简短回复生日祝福语
17 校长送毕业祝福语简短
18 毕业立体贺卡祝福语简短