📄 testdemo.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 + -