Java Reflection dzÎö1
Reflection µÄ¼òµ¥Ó¦Ó㬰üÀ¨field£¬ method£¬constructorµÄÓ¦Óá£
package com.gaoqian.reflection;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.Type;
abstract class BaseClass1 {
private int bi;
protected String bs;
public char bc;
public BaseClass1(int bin, String bstr, char bch) {
this.bi = bin;
this.bs = bstr;
this.bc = bch;
}
public int getIntValue() {
return bi;
}
public void setIntValue(int in) {
this.bi = in;
}
public abstract String out();
}
class DerivedClass2 extends BaseClass1 {
private int ddi;
protected String dds;
public char ddc;
public DerivedClass2(int ddin, String ddstr, char ddch) {
super(ddin + 100, ddstr + "BaseClass", ddch);
this.ddi = ddin;
this.dds = ddstr;
this.ddc = ddch;
}
public String getStringValue() {
return dds;
}
public void setStringValue(String str) {
this.dds = str;
}
@Override
public String out() {
return "The content of BaseClass is " + super.getIntValue() + super.bc
+ super.bs + "\n" + "The content of DerivedClass is "
+ this.ddi + this.dds + this.ddc;
}
}
public class TestingReflection {
public static void main(String[] args) {
// System.out.println("***showFieldsInfo()***");
// showFieldsInfo();
// System.out.println("***operateFieldValue()***");
// operateFieldValue();
// System.out.println("***showMethodInfo()***");
// showMethodInfo();
// System.out.println("***invokeMethod()***");
// invokeMethod();
// &
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
ÏÖÔÚ ËùÓÃJava°æ±¾,DateÀ๹Ôì·½·¨Date(0)µÄʱ¼ä²»ÊÇThu Jan 01 01:00:00 GMT 1970ÁË£¬¶øÊÇThu Jan 01 08:00:00 CST 1970¡££¨ 1970 Äê1 ÔÂ1 ÈÕ8ʱ0·Ö0Ãë ÐÇÆÚ4£©
Ϊʲô Date b1=new Date(623289600000); ²»¿ÉÒÔ£¬ÏÂÃæµÄÈ´¿ÉÒÔÄØ£¿
long a=623289600000L;
Date b1=new Date(a); Ò ......
Thread.currentThread().getName().equals("xxxx") ÕâÌõÓï¾ä·µ»ØÒ»¸ö bool Ð͵Ľá¹û¡£Åжϵ±Ç°ÔËÐеĽø³ÌÊÇ·ñºÍ xxxx µÄÃû×ÖÒ»Ñù¡£
¶¨ÒåÏ̵߳ÄÁ½ÖÖ·½·¨£ºclass a1 extends Thread{ } a1 xiancheng=new a1();
¶þÊÇ£ºÓýӿڻص÷¼¼Êõ¡£ class a1 implements Runnable{ } a1 ......
¶Ô³õѧÕßÓ¦¸Ã»áÓаïÖúËùÒÔתÔØÁË¡£
ÕâÈý¸öÓïÑÔ·Ö±ðÊÇÈý¸ö¹«Ë¾¿ª·¢µÄ£¬SUNµÄJava£¬NetscapeµÄJavaScript£¬MicrosoftµÄJScript
JavaScriptÊÇÓÉNetscape¹«Ë¾¿ª·¢²¢ËæNavigatorµ¼º½ÕßÒ»Æð·¢²¼µÄ¡¢½éÓÚJavaÓëHTMLÖ®¼ä¡¢»ùÓÚ¶ÔÏóʼþÇý¶¯µÄ±à³ÌÓïÑÔ£¬²»ÐèÒªJava±àÒëÆ÷£¬¶øÊÇÖ±½ÓÔËÐÐÔÚWebä¯ÀÀÆ÷ÖУ¬ËüµÄÇ°ÉíÊÇLive Script¡£
......
Java´«µÝ²ÎÊýÓÐÁ½ÖÖ £ºÖµ´«µÝ£¬ÒýÓô«µÝ
Ò»°ãÒýÓÃÀàÐÍ ÊÇÒýÓô«µÝ£¬ÖµÀàÐÍÊÇÖµ´«µÝ
ÖµÀàÐÍÊÇÔʼÊý¾ÝÀàÐÍ °üÀ¨ int,byte,char short long,boolean,float,double
ÒýÓÃÀàÐ;ÍÊÇÒ»°ãµÄclassÀà µ±È»Ò²°üÀ¨ÔʼÊý¾ÝµÄ·â×°ÀàÐÍ ±ÈÈçintµÄ
·â×°ÀàÐÍΪInteger
Ò»°ãÇé¿öÏ£º
Öµ´«µÝ£º
Àý×Ó 1 public void show1(int str ......