分類信息
各地考試

當前位置:首頁 » Java認證 » 模擬試題 » 正文

2014年Java認證SCJP模擬習題:SCJPMockExam(4)


時間:2013-10-31 來源:Java認證考試網 瀏覽次數:93  【華夏培訓網:中國教育培訓第一門戶

Q21What does the value returned by the method getID() found in class java.awt.AWTEvent uniquely identify?1) The particu

Q21 
What does the value returned by the method getID() found in class java.awt.AWTEvent uniquely identify? 

1) The particular event instance. 
2) The source of the event. 
3) The set of events that were triggered by the same action. 
4) The type of event. 
5) The type of component from which the event originated. 

Q22 
What will be written to the standard output when the following program is run? 

class Base { 
int i; 
Base() { 
add(1); 
} 
void add(int v) { 
i += v; 
} 
void print() { 
System.out.println(i); 
} 
} 
class Extension extends Base { 
Extension() { 
add(2); 
} 
void add(int v) { 
i += v*2; 
} 
} 
public class Qd073 { 
public static void main(String args[]) { 
bogo(new Extension()); 
} 
static void bogo(Base b) { 
b.add(8); 
b.print(); 
} 
} 

1) 9 
2) 18 
3) 20 
4) 21 
5) 22

Q23 
Which lines of code are valid declarations of a native method when occurring within the declaration of the following class? 

public class Qf575 { 
// insert declaration of a native method here 
} 

1) native public void setTemperature(int kelvin); 
2) private native void setTemperature(int kelvin); 
3) protected int native getTemperature(); 
4) public abstract native void setTemperature(int kelvin); 
5) native int setTemperature(int kelvin) {} 

Q24 
How does the weighty property of the GridBagConstraints objects used in grid bag layout affect the layout of the components? 

1) It affects which grid cell the components end up in. 
2) It affects how the extra vertical space is distributed. 
3) It affects the alignment of each component. 
4) It affects whether the components completely fill their allotted display area vertically. 

Q25 
Which statements can be inserted at the indicated position in the following code to make the program write 1 on the standard output when run? 

public class Q4a39 { 
int a = 1; 
int b = 1; 
int c = 1; 
class Inner { 
int a = 2; 
int get() { 
int c = 3; 
// insert statement here 
return c; 
} 
} 
Q4a39() { 
Inner i = new Inner(); 
System.out.println(i.get()); 
} 
public static void main(String args[]) { 
new Q4a39(); 
} 
} 

1) c = b; 
2) c = this.a; 
3) c = this.b; 
4) c = Q4a39.this.a; 





        Java認證

推薦圖文

熱門點擊排行

©2015 hxpx.com All Rights Reserved 滇ICP備13002816號-1
華夏培訓網唯一網址www.aozbus.tw

广西快3预测号码