⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testset.java

📁 集合类
💻 JAVA
字号:
import java.io.*;
public class TestSet
{
	public static void main(String[] args)
	{
		int a=0,b=0;
		String  digit;
		int test=1;
		Set sa=null;
		Set sb=null;
		Set sc=null;
		Set sd=null;
		System.out.println("集合A的大小:");
		try
		{
			BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
			digit=br.readLine( );
			a=Integer.parseInt(digit);
		}catch(IOException e){}
		System.out.println("集合B的大小:");
		try
		{
			BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
			digit=br.readLine( );
			b=Integer.parseInt(digit);
		}catch(IOException e){}
		sa=new Set(a);
		sb=new Set(b);
		sc=sa;sd=sb;
		System.out.println("集合A:   "+sa);
		System.out.println("集合B:   "+sb);
		sa.unite(sb);
		System.out.println("集合A并B:"+sa);
		sc.intersection(sd);
		System.out.println("集合A交B:"+sc);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -