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説明的函數,作用是...
-
初級網絡工程師簡介
網絡工程師是指基於硬、軟件兩方面的工程師,根據硬件和軟件的不同、認證的不同,將網絡工程師劃分成很多種類。下面是小編整理的初級網絡工程師簡介,希望大家認真閲讀!網絡基礎知識:深度網絡基本概念,例如>ISO/OSI、TCP/IP、VLAN、各種LAN、WAN協議、各種路由協議、N...
-
NIIT認證詳細介紹
NIIT(印度國家信息技術學院)成立於1981年,是總部設在印度首都新德里的信息技術(IT)跨國公司。yjbys小編分享一些NIIT認證介紹及考試説明,歡迎大家閲讀!NIIT認證介紹niit——國際it軟件職業教育培訓的先鋒印度的it職業教育培訓起始於1982年,其創導者是ni...