1、抽象类和接口的区别?(1)接口可以被多重 implements,抽象类只能被单一 extends(2)接口只有定义,抽象类可以有定义和实现(3)接口的字段定义默认为:public static final, 抽象类字段默认是"friendly"(本包可见)当功能需要累积时用抽象类,不需要累积时用接口。2、什么是类的返射机制?通过类(Class 对象),可以得出当前类的 fields、method、construtor、interface、superClass、modified 等,同是可以通过类实例化一个实例、设置属性、唤醒方法。Spring 中一切都是返射、struts、hibernate 都是通过类的返射进行开发的。3、类的返射机制中的包及核心类?java.lang.Classjava.lang.refrection.Methodjava.lang.refrection.Fieldjava.lang.refrection.Constructorjava.lang.refrection.Modifierjava.lang.refrection.Interface4、得到 Class 的三个过程是什么?对象.getClass()类.class 或 Integer.type(int)Integer.class(java.lang.Integer)Class.forName();5、如何唤起类中的一个方法?产生一个 Class 数组,说明方法的参数通过 Class 对象及方法参数得到 Method通过 method.invoke(实例,参数值数组)唤醒方法6、如何将数值型字符转换为数字(Integer,Double)?Integer.parseInt(“1234”)Double.parseDouble(“123.2”)7、如何将数字转换为字符?1+””1.0+””8、如何去小数点前两位,并四舍五入。double d=1256.22d;d=d/100;System.out.println(Math.round(d)*100);9、如何取得年月日,小时分秒?Calendar c=Calendar.getInstance();c.set(Calendar.YEAR,2004);c.set(Calendar.MONTH,0);c.set(Calendar.DAY_OF_MONTH,31);System.out.println(c.get(Calendar.YEAR)+""+(c.get(Calendar.MONTH)+1)+" "+c.get(Calendar.DAY_OF_MONTH));10、如何取得从 1970 年到现在的毫秒数Java.util.Date dat=new Date();long now=dat.getTime();11、如何获取某个日期是当月的最后一天?当前日期加一天,若当前日期与结果的月份不相同,就是最后一天。取下一个月的第一天,下一个月的第一天-1public static void main(String[] args){Calendar c=Calendar.getInstance();c.set(Calendar.YEAR,2004);c.set(Calendar.MONTH,0);c.set(Calendar.DAY_OF_MONTH,30);Calendar c1=(Calendar)c.clone();System.out.println(c.get(Calendar.YEAR)+""+(c.get(Calendar.MONTH)+1)+" "+c.get(Calendar.DAY_OF_MONTH));c.add(Ca...