亚洲精品成人18久久久久_日韩欧美色_江苏极品身材白嫩少妇自拍_曰本人做爰大片免费观看一老师_久草视频网_最近中文字幕MV高清在线视频

首頁 > 考試輔導 > 計算機考試 > JAVA認證 > JAVA認證試題集錦 > SUN認證Java2程序員考試(SCJP) 試題解析(2)

SUN認證Java2程序員考試(SCJP) 試題解析(2)

which of the following lines of code will compile without error?  
a.  
int i=0;  
if (i) {  
system.out.println(“hi”);  
}  
b.  
boolean b=true;  
boolean b2=true;  
if(b==b2) {  
system.out.println(“so true”);  
}  
c.  
int i=1;  
int j=2;  
if(i==1|| j==2)  
system.out.println(“ok”);  
d.  
int i=1;  
int j=2;  
if (i==1 &| j==2)  
system.out.println(“ok”);  
解答:b, c  
點評:選項a錯,因為if語句后需要一個boolean類型的表達式。邏輯操作有^、&、| 和 &&、||,但是“&|”是非法的,所以選項d不正確。  

例題5:  
which two demonstrate a "has a" relationship? (choose two)  
a. public interface person { }  
public class employee extends person{ }  
b. public interface shape { }  
public interface rectandle extends shape { }  
c. public interface colorable { }  
public class shape implements colorable  
{ }  
d. public class species{ }  
public class animal{private species species;}  
e. interface component{ }  
class container implements component{  
private component[] children;  
}  
解答:d, e  
  點評: 在java中代碼重用有兩種可能的方式,即組合(“has a”關系)和繼承(“is a”關系)。“has a”關系是通過定義類的屬性的方式實現的;而“is a”關系是通過類繼承實現的。本例中選項a、b、c體現了“is a”關系;選項d、e體現了“has a”關系。  

例題6:  
which two statements are true for the class java.util.treeset? (choose two)  
a. the elements in the collection are ordered.  
b. the collection is guaranteed to be immutable.  
c. the elements in the collection are guaranteed to be unique.  
d. the elements in the collection are accessed using a unique key.  

e. the elements in the collection are guaranteed to be synchronized  
解答:a, c  
  點評:treeset類實現了set接口。set的特點是其中的元素惟一,選項c正確。由于采用了樹形存儲方式,將元素有序地組織起來,所以選項a也正確。  

例題7:  
true or false: readers have methods that can read and return floats and doubles.  
a. ture  
b. false  
解答:b  
  點評: reader/writer只處理unicode字符的輸入輸出。float和double可以通過stream進行i/o.  

例題8:  
what does the following paint() method draw?  
1. public void paint(graphics g) {  
2. g.drawstring(“any question”, 10, 0);  
3. }  
a. the string “any question?”, with its top-left corner at 10,0  
b. a little squiggle coming down from the top of the ;component.  
解答:b  
  點評:drawstring(string str, int x, int y)方法是使用當前的顏色和字符,將str的內容顯示出來,并且最左的字符的基線從(x,y)開始。在本題中,y=0,所以基線位于最頂端。我們只能看到下行字母的一部分,即字母‘y’、‘q’的下半部分。
主站蜘蛛池模板: 欧美精品video | 欧美极品日韩极品1 | 国产亚洲精品美女 | 欧美成人久久久 | v888aⅴ视频在线播放 | 少妇挑战三个黑人惨叫4p国语 | 国产免费一区二区三区播放 | 亚洲日韩中文第一精品 | 国产精品www.| Chinese国产高清Av | 欧美综合社区 | 国产黄色片免费 | 精品国模一区二区三区浪潮 | 久碰久摸久看视频不卡视频 | 97人妻人人澡人人爽国产 | 成年无码av动漫网站天堂网 | 色黄视频在线 | 成人午夜激情福利最新在线播放 | 一级一级一片在线观看 | 国精产品一区二区 | 欲香欲色天天综合和网 | 一本久道中文字幕精品亚洲嫩 | 国产成人A∨麻豆精品 | 免费看裸体美女脱了衣服露视频胸 | 久久久久久久久久久久中文字幕 | 农村少妇好紧水多视频 | 欧美另类一区 | 久久婷婷五月综合色99啪 | 99久久777色| 蜜臀av性久久久久蜜臀aⅴ流畅 | 免费观看男女性高视频 | 日韩av免费无码一区二区三区 | 日本一区二区三区在线不卡 | 久久69精品久久久久久国产越南 | 2017狠狠拍狠狠狠色 | 满天神佛国语免费观看 | 欧美一级淫片免费视频1 | AV无码国产精品午夜A片 | 免费观看在线a级毛片 | 国产精品毛片一区二区三区 | 国产91av在线 |