摘要:
1.内部类可以直接访问外部类中的成员,包括私有原因:因为在内部类中持有一个外部类的应用,格式:外部类.thisclass Outer {private int x = 1;class Inner {int x = 2;public void seeOuter() {int x = 3;System.out.println(x);System.out.println(this.x);System.out.println(Outer.this.x);}}}2.外部类要访问内部类,必须建立内部类对象A.从外部类的非静态方法中访问内部类class Outer {private int x = 1;pu 阅读全文
摘要:
IOC指控制反转,通过依赖注入来实现;依赖注入设计的知识点:1、了解常见属性的注入,int String list set map的注入2、属性编辑器,就是将Spring配置文件中的字符串转化为相应的java对象,Spring内置了一些属性编辑器,也可以通过自定义的编辑器3、如何自定义属性编辑器:继承PropertyEditorSupport---->覆盖setAsText()方法---->将自定义的属性编辑器进行配置4、Spring多配置文件读取方法:数组;通配符*5、减少Spring的配置文件方法:设置公共bean的配置属性abstract为true,并在其他bean的标签中指 阅读全文