Test of the Java Skill(2)
2008-01-05 20:29:26 来源:WEB开发网 闂傚倸鍊搁崐鎼佸磹閹间礁纾归柟闂寸绾惧綊鏌熼梻瀵割槮缁炬儳缍婇弻鐔兼⒒鐎靛壊妲紒鐐劤缂嶅﹪寮婚悢鍏尖拻閻庨潧澹婂Σ顔剧磼閻愵剙鍔ょ紓宥咃躬瀵鎮㈤崗灏栨嫽闁诲酣娼ф竟濠偽i鍓х<闁诡垎鍐f寖闂佺娅曢幑鍥灳閺冨牆绀冩い蹇庣娴滈箖鏌ㄥ┑鍡欏嚬缂併劎绮妵鍕箳鐎n亞浠鹃梺闈涙搐鐎氫即鐛崶顒夋晬婵絾瀵ч幑鍥蓟閻斿摜鐟归柛顭戝枛椤牆顪冮妶搴′簼缂侇喗鎸搁悾鐑藉础閻愬秵妫冮崺鈧い鎺戝瀹撲礁鈹戦悩鎻掝伀缁惧彞绮欓弻娑氫沪閹规劕顥濋梺閫炲苯澧伴柟铏崌閿濈偛鈹戠€n€晠鏌嶆潪鎷屽厡闁汇倕鎳愮槐鎾存媴閸撴彃鍓卞銈嗗灦閻熲晛鐣烽妷褉鍋撻敐搴℃灍闁绘挻娲橀妵鍕箛闂堟稐绨肩紓浣藉煐濮樸劎妲愰幘璇茬闁冲搫鍊婚ˇ鏉库攽椤旂》宸ユい顓炲槻閻g兘骞掗幋鏃€鐎婚梺瑙勬儗閸樺€熲叺婵犵數濮烽弫鍛婃叏椤撱垹纾婚柟鍓х帛閳锋垶銇勯幒鍡椾壕缂備礁顦遍弫濠氱嵁閸℃稒鍊烽柛婵嗗椤旀劕鈹戦悜鍥╃У闁告挻鐟︽穱濠囨嚃閳哄啰锛滈梺褰掑亰閸欏骸鈻撳⿰鍫熺厸閻忕偟纭堕崑鎾诲箛娴e憡鍊梺纭呭亹鐞涖儵鍩€椤掑啫鐨洪柡浣圭墪閳规垿鎮欓弶鎴犱桓闂佸湱枪閹芥粎鍒掗弮鍫熷仺缂佸顕抽敃鍌涚厱闁哄洢鍔岄悘鐘绘煕閹般劌浜惧┑锛勫亼閸婃牠宕濋敃鈧…鍧楀焵椤掍胶绠剧€光偓婵犱線鍋楀┑顔硷龚濞咃絿妲愰幒鎳崇喓鎷犻懠鑸垫毐闂傚倷鑳舵灙婵炲鍏樺顐ゆ嫚瀹割喖娈ㄦ繝鐢靛У绾板秹寮查幓鎺濈唵閻犺櫣灏ㄥ銉р偓瑙勬尭濡繂顫忛搹鍦<婵☆垰鎼~宥囩磽娴i鍔嶉柟绋垮暱閻g兘骞嬮敃鈧粻濠氭偣閸パ冪骇鐎规挸绉撮—鍐Χ閸℃ê闉嶇紓浣割儐閸ㄥ墎绮嬪澶嬪€锋い鎺嶇瀵灝鈹戦埥鍡楃仯闁告鍕洸濡わ絽鍟崐鍨叏濡厧浜鹃悗姘炬嫹

Question 9:
What code placed after the comment:
// Start For loop
would populate the elements of the array ia[] with values of the variables i ?
public class Lin{
public static void main(String argv[]){
Lin l = new Lin();
l.amethod();
}
public void amethod(){
int ia[] = new int[4];
// Start For loop
{
ia[i] = i;
System.out.PRintln(ia[i]);
}
}
}
A. for(int i=0; i
B. for (int i=0; i
C. for(int i=0; i<4; i++)
D. for(int i=0; i
Question 10:
Consider the following code:
Integer s = new Integer(9);
Integer t = new Integer(9);
Long u = new Long(9);
Which test would return true?
A. (s==u)
B. (s==t)
C. (s.equals(t))
D. (s.equals(9))
E. (s.equals(new Integer(9))
Question 11:
Which of the following is sUCcessfully create an instance of the Vector class and add an element?
A. Vector v = new Vector(99);
v[1]=99;
B. Vector v = new Vector();
v.addElement(99);
C. Vector v = new Vector();
v.add(99);
D. Vector v = new Vector(100);
v.addElement(“99”);
Question 12:
What will happen when you attempt to compile and run the following code?
class Base{
private void amethod(int iBase){
System.out.println(“Base.amethod”);
}
}
class Over extends Base{
public static void main(String argv[]){
Over o = new Over();
int iBase=0;
o.amethod(iBase);
}
public void amethod(int iOver){
System.out.println(“Over.amethod”);
}
}
A. Compile time error complaining that Base.amethod is private
B. Runtime error complaining that Base.amethod is private
C. Output of Base.amethod
D. Output of Over.amethod
Question 13:
What will happen if you try to compile and run the following code?
public class MyClass
public static void main(String arguments[]){
amethod(arguments);
}
public void amethod(String[] arguments)
System.out.println(arguments);
System.out.println(arguments[1]);
}
}
A. Error can't make static reference to void amethod
- ››office默认输入法设置
- ››Office2010操作小技巧:使用Excel聊天
- ››Office2010操作技巧:Excel自动读取单元格内容
- ››Office2007新文件格式的优点
- ››Office 2010 新特性:Outlook 2010
- ››Office 2010 新特性:PowerPoint 2010
- ››Office 2010 新特性: Excle 2010
- ››Office中Word十技巧 受益终身
- ››Office 2010宝典 word之利用文档导航窗格控制文档...
- ››Office 2010宝典 word之(2)利用文档导航窗格搜索文...
- ››Office 2010宝典 word之(3)可以朗读的屏幕取词翻译...
- ››Office 2010宝典 word之(4)多语言翻译
更多精彩
赞助商链接