public static void main(String[] args) throws Exception{ // TODO Auto-generated method stub AA a=new AA(1,"wms1"); BB b=new BB(2,"wms2"); //显示某对象的某方法和某属性 show(a,"show"); } //对未知类型的对象操作 public static vo id show(Object obj,String method_name)throws Ex
JAVA高级特性 1.静态导入:先举个离例子 。 import java.lang.Integer.parseInt; public class StaticImport { int x = parseInt("123"); System.out.println(x); } 这样的程序如果不在IDE 工具中输入,是很难看出这个程序代码会出现问题,可它偏偏就出问题了,这是为什么呢?因为程序里面有个静态方法,如果导入import static java.lang.Integer.p arseInt
import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; import org.apache.jasper.runtime.*; public class logout_0002ejsp_jsp extends HttpJspBase { // begin [file="/logout.jsp";from=(0,0);to=(0,65)] // end static { } public l
public class ObjectUtil { //public static Object request2Obj(HttpServletRequest request, Class clazz) { public static Object request2Obj(Request request, Class clazz) { try { Object obj = clazz.newInstance(); Method ms[] = clazz.getMethods(); for (i