NIIT認證J2ME考試真題
1) 下面的哪個包包含由MIDP支援的GUI元件?P3.5
1. et 2.
3. 4. i
2) 思考下面的程式碼:
import et.*;
import i.*;
public class Hello extends MIDlet
{
private Display Exhibit;
private Form show;
public Hello()
{
Exhibit = isplay(this);
show = new Form("Name");
}
public void startApp() throws MIDletStateChangeException
{
urrent(show);
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
}
下面的哪個程式碼段應該被增加到上述的程式碼中來建立一個字串項並將它顯示在螢幕上?P2.8-2.9
1. StringItem strIt = new StringItem(" ", "Msg"); nd(strIt);
2. StringItem strIt = new StringItem(" ", "Msg"); nd(strIt);
3. show = new StringItem(" ", "Msg"); nd(strIt);
4. StringItem strIt = new StringItem(" ", "Msg"); nd(show);
3) 你正在為一個銀行程式開發一個MIDlet。當客戶向銀行傳送一個請求時,一個程序指示將一直顯示,直到請求被處理完為止。程序指示應該被嵌入到form元件中。下面 的哪個方法可以在裝置螢幕上顯示程序指示?P4.16
1. public void showGauge() { Form form = new Form(“Gauge”); Gauge gauge = new Gauge (“Progress”, false, 100, 0); nd (gauge); Display display = isplay(this); urrent(form); }
2. public void showGauge() { Gauge gauge = new Gauge (“Progress”, false, 100, 0); Display display = isplay(this); urrent(gauge); }
3. public void showGauge() { Form form = new Form(“Gauge”); Gauge gauge = new Gauge (“Progress”, false, 100, 0); nd (gauge); urrent(form); }
4. public void showGauge() { Form form = new Form(“Gauge”); Gauge gauge = new Gauge (“Progress”, false, 100, 0); nd (gauge); Display display = urrent(form); urrent(gauge); }
4) 在J2ME中,下面的哪個包可以使用網路連線?P3.4
1. et
2. i
3.
4.
5) 思考下面的陳述:
陳述A:標準的J2ME工具包可以解析XML檔案。
標準B:基於XML直譯器的事件儲存被移動裝置解析的整個XML檔案。
關於上面陳述,下面哪項是正確的?P5.20
1. 陳述A是正確的,陳述B是錯誤的。 2. 陳述A是錯誤的,陳述B是正確的。
3. 兩個陳述都是正確的。 4. 兩個陳述都是錯誤的。
6) 你正在編寫連線到Web伺服器上執行的一個servlet的MIDlet程式碼。MIDlet的程式碼段如下所示:
public void connhandler()
{
HttpConnection con = null;
display("Obtaining Connection from Server..." );
try
{
con = ect(url, this );
display("Connecting to the server..." );
int response = esponseCode();
if( response == _OK )
{
StringBuffer text = new StringBuffer();
// Here's where you read the data.
// This case expects an integer
// followed by zero or more
// strings.
try
{
DataInputStream din = new DataInputStream(InputStream() );
int n = Int();
while( n-- > 0 )
{
nd(UTF() );
nd( '"n' );
}
}
catch( IOException e )
{
}
done("Your current balance:"n" + ring() );
}
else
{
done("Unexpected return code: " + rc );
}
}
catch( IOException e )
{
done( "Exception " + e + " trying to connect." );
}
}
編譯MIDlet程式碼後,你試圖不啟動Web伺服器來連線servlet。根據上面的程式碼段,程式將會輸出什麼?P6.17
1. Unexpected return code: 500
2. Unexpected return code: 302
3. Unexpected return code: 303
4. Exception ception trying to connect
7) 一個文字檔案包含幾行文字,一個在MIDlet和文字檔案之間的連線已經被建立。下面的哪個程式碼段將開啟一個輸入連線並每次從這個文字檔案中獲取一行文字?P5.12
1. InputStream ins = null; ins = InputStream(); StringBuffer buffer = new StringBuffer(); int i; while ((i=())!= -1) { if (i!='"n') { nd(i); } }
2. InputStream ins = null; ins = InputStream(); StringBuffer buffer = new StringBuffer(); int i; while ((i=())!= -1) { if (i!='"n') { nd((char)i); } }
3. InputStream ins = null; ins = OutputStream(); StringBuffer buffer = new StringBuffer(); int i; while ((i=())!= -1) { if (i!='"n') { nd((char)i); } }
4. InputStream ins = null; ins = InputStream(); StringBuffer buffer = new StringBuffer(); char i; while ((i=())!= -1) { if (i!='"n') { nd((char)i); } }
8) 確定包的類。P3.4
1. Connector 和 ConnectionNotFoundException 2. InputStream 和OutputStream
3. DataInput 和 DataOutput 4. DataInputStream 和 DataOutputStream
9) RecordEnumeration介面定義了下面的`哪個方法?P7.4
1. enumerateRecords() 2. getRecord() 3. nextRecord() 4. addRecord()
10) 程式碼段如下所示:(19)
程式碼段1:
byte[] ba = new byte[50];
int nob = ecord (id, ba, 0);
程式碼段2:
byte[] ba = null;
ba = ecord (id);
程式碼段3:
byte[] ba = new byte[50];
ba = ecord (id);
程式碼段4:
byte[] ba = null;
int nob = ecord (id, ba);
用下面哪個程式碼段從記錄儲存中獲取一條特定記錄?P7.8
1. 僅程式碼段1和程式碼段3 2. 僅程式碼段2和程式碼段4
3. 程式碼段2、程式碼段3和程式碼段4 4. 程式碼段1、程式碼段2和程式碼段3
11) SaveMyMoney銀行為他們的客戶介紹移動銀行業務。有一個應用程式使用名為的記錄儲存,使客戶方便的記錄所有提交到銀行的單據。你能夠使用下面哪段程式碼獲取中的列舉物件?P7.10
1. public void getEnum() { RecordStore rs; rs = RecordStore(“checks”, true); rs = erateRecords (null, null, false); }
2. public void getEnum() { RecordEnumeration re; RecordStore rs; rs = RecordStore(“checks”, true); re = erateRecords (null, null, false); }
3. public void getEnum() { RecordStore rs; rs = RecordStore(“checks”, true); RecordEnumeration re = erateRecords (null, null, false); }
4. public void getEnum() { RecordEnumeration re; RecordStore rs; rs = RecordStore(“checks”, true); rs = erateRecords (null, null, false); }
-
2016年c++經典面試題及答案
1.C++的類和C裡面的struct有什麼區別?struct成員預設訪問許可權為public,而class成員預設訪問許可權為private2.解構函式和虛擬函式的用法和作用解構函式是在物件生存期結束時自動呼叫的函式,用來釋放在建構函式分配的記憶體。虛擬函式是指被關鍵字virtual說明的函式,作用是...
-
軟體工程(與NIIT合作嵌入式培養)專業介紹
本專業是江蘇省十二五重點專業(計算機類),培養具有優良綜合素質和較強實踐能力的國際化軟體工程人才。擁有一支經過NIIT專業認證的師資隊伍,借鑑NIIT先進的`教學理念、教學模式和課程體系,引進實踐性很強的NIIT國際化課程,突出實踐教學環節,大幅增加雙語課程。核心...
-
2017網路工程師考試知識點:網路管理協議
NMP(簡單網路管理協議)是最早提出的網路管理協議之一,已成為網路管理領域中事實上的工業標準,並被廣泛支援和應用,大多數網路管理系統和平臺都是基於SNMP的。SNMP是一個非同步的請求/響應協議,是一個非面向連線的協議,這樣SNMP實體不需要在發出請求後立即等待響應的到...
-
網路工程師學歷要求
網路工程師分硬體網路工程師和軟體網路工程師兩大類,硬體網路工程師以負責網路硬體等物理裝置的維護和通訊;軟體網路工程師負責系統軟體,應用軟體等的維護和應用。下面是小編整理的網路工程師學歷要求,歡迎大家參考!要求A1.良好的學習能力,對技術有專研的熱情;熱愛...