Class cl=null;
為山南等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計制作服務(wù),及山南網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為成都網(wǎng)站設(shè)計、成都網(wǎng)站制作、外貿(mào)網(wǎng)站建設(shè)、山南網(wǎng)站設(shè)計,以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會得到認(rèn)可,從而選擇與我們長期合作。這樣,我們也可以走得更遠(yuǎn)!
try{
cl=Class.forName("java.lang.Array");
}catch(Exception e){}
System.out.print("1231321wdfs");
Field[] f=cl.getDeclaredFields();
java中沒有java.lang.Array這個類..所以cl=Class.forName("java.lang.Array");這句會報錯的...
但是catch(Exception e){}你的捕獲異常這什么都沒有做..
所以你看不到..于是cl還是為null..所以Field[] f=cl.getDeclaredFields();就會報異常了..
可以將java.lang.Array改為java.lang.String等等存在的類..
什么都不輸出是因為java.lang.reflect.Array這個類里面沒有任何屬性。。
你用java.lang.String試下就知道了哈。。
package ox;public class entity {
private int year; private int bignum; private int smallone; private int smalltwo; private int smallthree; public int getBignum() {
return bignum;
} public void setBignum(int bignum) {
this.bignum = bignum;
} public int getSmallone() {
return smallone;
} public void setSmallone(int smallone) {
this.smallone = smallone;
} public int getSmallthree() {
return smallthree;
} public void setSmallthree(int smallthree) {
this.smallthree = smallthree;
} public int getSmalltwo() {
return smalltwo;
} public void setSmalltwo(int smalltwo) {
this.smalltwo = smalltwo;
} public int getYear() {
return year;
} public void setYear(int year) {
this.year = year;
}} package ox;public interface dao {
public int getNum(int bignum, int smallone, int smalltwo, int smallthree,
int year);
}
package ox;import ox.entity;
import ox.dao;public class impl extends entity implements dao {
public int getNum(int bignum, int smallone, int smalltwo, int smallthree,
int year) {
// TODO Auto-generated method stub
int i = 0;
int x, y, z;
for (i = 0; i = year; i++) {
x = smallone;
y = smalltwo;
z = smallthree;
smalltwo = x;
smallthree = y;
bignum += z;
smallone = bignum;
}
int num = bignum + smallone + smalltwo + smallthree;
System.out.println(year + "年后共有母牛" + num + "只"); return num;
}}
package ox;public class test { /**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
entity e = new impl();
dao d = new impl();
e.setBignum(0);
e.setSmallone(1);
e.setSmalltwo(0);
e.setSmallthree(0);
e.setYear(20);
d.getNum(e.getBignum(), e.getSmallone(), e.getSmalltwo(), e
.getSmallthree(), e.getYear());
}}
dd if=/dev/zero of=/swapadd bs=1024 count=524288
以上的命令是建立一個名為swapadd的交換空間,大小是521M。