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

📄 testdemo.java

📁 学了2个月java 练习用~ 可以看下 希望同意
💻 JAVA
字号:
import java.util.*;

public class TestDemo
{
	public static void main(String[] args)
	{
		 testPojo_ListDemo();
	}

	public static void testScoreMapDemoDao(){
		String a[]={"4","2","3"};
		String b[]={"a","b","c"};
		String c[]={"4","2"};
		ScoreMapDemoDao test=new ScoreMapDemoDao();
		test.putIntoMap(a,b);
		test.printMapByKeySet();
		test.printMap(c);
	}

	public static void testStudentDemo(){
		StudentDemo now=new StudentDemo();
		Address nowadd=now.toBeAddress("China","SH","pd",57);
		Student a=now.toBePojo("zhou",21,false,1,nowadd);
		Student b=now.toBePojo("han",22,false,2,nowadd);
		Student c=now.toBePojo("feng",22,false,3,nowadd);
		now.addToArray(a);
		now.addToArray(b);
		now.addToArray(c);
		now.printArray();
	}

	public static void testMapDemo(){
		MapDemo test=new MapDemo();
		Student a=test.tobePojo("1:jim:25:true:China:ShangHai:laoshanDOnglu:521");
		Student b=test.tobePojo("2:roger:30:false:China:beijing:laoshanDOnglu:921");
		test.addToMap(b);
		test.addToMap(a);
		test.printMap();
	}

	public static void testStudentManager(){
		StudentDemo now=new StudentDemo();
		Address nowadd=now.toBeAddress("China","SH","pd",57);
		Student a=now.toBePojo("zhou",21,false,1,nowadd);
		Student b=now.toBePojo("han",22,false,2,nowadd);
		Student c=now.toBePojo("feng",22,false,3,nowadd);
		StudentManager test=new StudentManager();
		test.saveStudent(c);
		test.saveStudent(b);
		test.saveStudent(a);
		test.updateStudent(b);
		b.print();
		test.deleteStudent(2);
		((Student)(test.test.get(2))).print();
	}

	public static void testPojo_ListDemo(){
		Pojo_ListDemo test=new Pojo_ListDemo();
		StudentDemo now=new StudentDemo();
		Address nowadd=now.toBeAddress("China","SH","pd",57);
		Object a=test.toBePojo("STUDENT", "zhou", 22, false, nowadd, 1);
		Object b=test.toBePojo("EMPLOYEE", "wang", 21, false, nowadd, 2);
		test.addToCollection(a);
		test.addToCollection(b);
		test.printCollection();
	}
}

⌨️ 快捷键说明

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