欧美精品在欧美一区二区少妇,久久久久成人影视,99热在线精品呀,草莓视频手机在线观看

當(dāng)前位置:

JAVA認(rèn)證歷年真題:SCJP考試真題和解析2

發(fā)表時(shí)間:2014/4/21 9:54:44 來(lái)源:互聯(lián)網(wǎng) 點(diǎn)擊關(guān)注微信:關(guān)注中大網(wǎng)校微信
關(guān)注公眾號(hào)

例題4:

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

點(diǎn)評(píng):選項(xiàng)A錯(cuò),因?yàn)閕f語(yǔ)句后需要一個(gè)boolean類(lèi)型的表達(dá)式。邏輯操作有^、&、| 和 &&、||,但是“&|”是非法的,所以選項(xiàng)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

點(diǎn)評(píng): 在Java中代碼重用有兩種可能的方式,即組合(“has a”關(guān)系)和繼承(“is a”關(guān)系)?!癶as a”關(guān)系是通過(guò)定義類(lèi)的屬性的方式實(shí)現(xiàn)的;而“is a”關(guān)系是通過(guò)類(lèi)繼承實(shí)現(xiàn)的。本例中選項(xiàng)A、B、C體現(xiàn)了“is a”關(guān)系;選項(xiàng)D、E體現(xiàn)了“has a”關(guān)系。

例題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

點(diǎn)評(píng):TreeSet類(lèi)實(shí)現(xiàn)了Set接口。Set的特點(diǎn)是其中的元素惟一,選項(xiàng)C正確。由于采用了樹(shù)形存儲(chǔ)方式,將元素有序地組織起來(lái),所以選項(xiàng)A也正確

相關(guān)鏈接JAVA認(rèn)證考試報(bào)考指南  考試論壇 考試知道   考試動(dòng)態(tài)

(責(zé)任編輯:fky)

2頁(yè),當(dāng)前第1頁(yè)  第一頁(yè)  前一頁(yè)  下一頁(yè)
最近更新 考試動(dòng)態(tài) 更多>
九九视频只有精品4| 色婷婷亚州| 欧洲亚洲欧洲特级片| 天天狠天天透天干天天怕∴ | 凸凹一区| t66y国产精品久久久| 无码高潮少妇毛多水多水| 超碰人人人人人人人人| 亚洲熟女专区| 伊人她婷婷8888| av一区二区色| 97精品人妻一区| 婷婷五月六月av| 六月婷婷天堂网| 又粗又长的视频| 亚洲精品123区| 婷婷色综合久久| WWW:C0m毛片网| 黄页网站免费看日韩| 草莓视频在线观看免费| 亚洲国产精品毛片| 看看一级片视频看看| 满18毛片| 欧美日韩精品一区二区三区不卡| 欧美日韩激情网站| 揉搓乳首在线| 日韩中文字幕97区| 懂色TⅤ| 亚洲六月激情| 欧美XX色综合色视频| 欧美超级乱婬视频播放| 超碰少妇激情V| 亚洲性爱视频一区二区| 97视频免费观看2区| 亚洲性综合| 日本后入| 成人久久久播放视频| 老司机福利| 男女xx网站| 欧美日韩亚洲亚洲综合| 超碰公开久久97|