public void generateObj() {
		try {
			Class<?> clazz = Class.forName("com.rock.reflect.User");
			//默认调用无参构造器
			Object u1 = clazz.newInstance();
			System.out.println(u1);
			//获取构造方法，再调用
			Constructor<?> constructor = clazz.getConstructor(int.class,String.class);
			Object u2 = (User) constructor.newInstance(1,"rock");
			System.out.println(u2);
			System.out.println("username:"+((User)u2).getUserName());
					
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (NoSuchMethodException e) {
			e.printStackTrace();
		} catch (SecurityException e) {
			e.printStackTrace();
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			e.printStackTrace();
		}
	}