1.valueOf赋值相同,new 的不同
Integer aInteger = Integer.valueOf(1);
Integer bInteger = Integer.valueOf(1);
System.out.println(aInteger == bInteger);//true
Integer cInteger = new Integer(1);
Integer dInteger = new Integer(1);
System.out.println(cInteger == dInteger);//false
System.out.println(aInteger == dInteger);//false
2.x和y拥有相同地址,new是不同的
String x = "a";
String y = x;
String z = new String("a");
System.out.println(x==y);//true
System.out.println(x==z);//false
3.abstract不能修饰变量,只能修饰类和方法
4.native本地化。Java平台有个用户和本地C代码进行互操作的API,称为Java Native Interface (Java本地接口)。
5.构造方法在类实例化对象时被自动调用。
6.concat()方法
String a = "app";
String b = a.concat("le");
System.out.println(b);//apple
7.J2EE 是使用 Java 技术开发企业级应用的工业标准
大致分为以下4种组件
《1》表现层组件,收集或展示信息,主要技术如JSP
《2》控制层组件,负责拦截和放行用户请求
《3》业务逻辑组件 ,系统核心组件,实现系统的业务逻辑。
《4》DAO组件,Data Access Object ,也称为数据访问对象,缺乏变化。每个DAO组件都是Domain Object对象基本的增删改查等操作。不同的访问技术。DAO组件的实现完全不同。为每个DAO都提供接口,业务逻辑组件面向DAO接口编程,从而更好的解耦。
《5》领域对象组件,(Domain Object)抽象了系统的对象模型。对应一个或多个数据表。8.
8.原子性
不受其他操作影响的任务单元,在多线程环境下有效地避免了数据不一致。
i++就不具有原子性。