2018年3月10日

摘要: package 测试2; public class Test { public static void main(String[] args) { int i=0; Integer j = new Integer(0); System.out.println(i==j);//true System.out.println(j.equals(i));//true S... 阅读全文
posted @ 2018-03-10 19:02 三盛乙烯 阅读(101) 评论(0) 推荐(0) 编辑

2018年3月9日

摘要: 简单描述一下定义继承这个概念: 就是在spring中生成两个bean:bean1和bean2 bean1定义了其内容(也就是property), bean2没有定义,或只定义了其一部分内容. 通过在xml文件中使用parent关键字定义继承, 使得bean2中没有定义的内容沿用bean1的内容. 这 阅读全文
posted @ 2018-03-09 19:06 三盛乙烯 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 三个文件都有改动: 阅读全文
posted @ 2018-03-09 16:27 三盛乙烯 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 和XmlBeanFactory 容器类几乎一样, 只不过BeanFactory容器更轻量化,也是采用DI(依赖注入)的方式. 阅读全文
posted @ 2018-03-09 13:50 三盛乙烯 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 首先创建两个类,HelloWorld.java和MainApp.java HelloWorld.java用来创建具体的类对象, MainApp.java用来执行操作。 然后要创建xml的配置文件映射spring框架和项目。 当然,首先要把spring框架的lib导入项目中。 以下是三个文件的具体代码 阅读全文
posted @ 2018-03-09 13:26 三盛乙烯 阅读(162) 评论(0) 推荐(0) 编辑
摘要: throws关键字和throw关键字的区别主要在于: 1.throws关键字在方法的声明上使用,表示此方法在调用的时候必须处理异常 2.throw关键字指的是在方法中,人为的抛出一个异常(这个异常对象可能是自己实例化,或者是抛出已经存在的) 阅读全文
posted @ 2018-03-09 11:47 三盛乙烯 阅读(430) 评论(0) 推荐(0) 编辑
摘要: package prepare1; class MyMath { static int result;// 想要不加static,就要一开始就给result赋一个值 public static int div(int a, int b) { System.out.println("=====计算开始====="); try { result = a / b; } cat... 阅读全文
posted @ 2018-03-09 11:37 三盛乙烯 阅读(118) 评论(0) 推荐(0) 编辑

2018年3月8日

摘要: * * * * * * * * * * * * * * * 阅读全文
posted @ 2018-03-08 20:40 三盛乙烯 阅读(108) 评论(0) 推荐(0) 编辑
摘要: * * * * * * * * * * * * * * * 阅读全文
posted @ 2018-03-08 20:37 三盛乙烯 阅读(125) 评论(0) 推荐(0) 编辑
摘要: package prepare1; import java.util.Arrays; public class Test { public static void main(String[] args) { int data[] = new int[] {1,5,6,3,8,9,2,4,7,10}; 阅读全文
posted @ 2018-03-08 20:05 三盛乙烯 阅读(94) 评论(0) 推荐(0) 编辑

导航