NIIT认证 百分网手机站

NIIT认证J2ME考试真题「最新」(2)

时间:2017-10-31 12:00:32 NIIT认证 我要投稿

NIIT认证J2ME考试真题「最新」

  19) 考虑下面的代码:

  import javax.microedition.midlet.*;

  import javax.microedition.lcdui.*;

  public class Date extends MIDlet

  { private Display disp;

  private Form show;

  public Date()

  {

  disp = Display.getDisplay(this);

  show = new Form(");

  Calendar current = Calendar.getInstance();

  String date = Integer.toString(current.get(Calendar.MONTH))+"/"+

  Integer.toString(current.get(Calendar.DAY_OF_MONTH))+"/"+

  Integer.toString(current.get(Calendar.YEAR));

  show.append(new StringItem(" ", "DATE: " + date));

  }

  public void startApp() throws MIDletStateChangeException

  { disp.setCurrent(show);

  }

  public void pauseApp()

  {

  }

  public void destroyApp(boolean unconditional)

  {

  }

  }

  编译上面的代码时,无论在何处使用Calendar类都将显示错误信息“cannot resolve symbol”。应包括下列哪条语句才能正确无误的编译该代码?P3.11

  1. import java.io.* 2. import java.microedition.io.*

  3. import java.util.* 4. import java.microedition.rms.*

  20) 将一个MIDlet应用程序保存为‘Hello.java’,并在命令行环境中测试。下列是测试该应用程序的命令:

  A. jar cf Hello.jar Hello.class,然后创建一个jad文件

  B. javac –classpath ." -d ." -bootclasspath c:"j2mewtk"lib"midpapi.zip Hello.java

  C. emulator –Xdescriptor:Hello.jad

  D. preverify –classpath c:"j2mewtk"lib"midpapi.zip –d ."

  下列哪个选项是在命令行环境中测试MIDlet应用程序的正确顺序?

  1. A、B、C 和D 2. B、D、A和 C 3. C、B、A和 D 4. A、D、B和C

  21) showForm()方法可用于在设备屏幕上显示一个窗体组件。下列哪一个是showForm()方法的正确实现?

  1. public void showForm() { Display disp = Graphics.getCurrent (this); disp.setCurrent(form); }

  2. public void showForm() { Display disp = Display.getDisplay (this); disp.setCurrent(form); }

  3. public void showForm() { Display disp = Graphics.getDisplay (this); disp.setCurrent(form); }

  4. public void showForm() { Display disp = Display.getCurrent (this); disp.setCurrent(form); }

  22) 下列哪一个是J2ME中所有输入的基类?

  1. DataInputStream 2. InputStream 3. InputStreamReader 4. ByteArrayInputStream

  23) 下列哪一个方法用于写单字节数据?P5.8

  1. write(int n) 2. write(byte b[], int offset, int length) 3. flush() 4. write(byte b[])

  24) 检索HTTP连接请求的响应代码使用的语句是:

  int code = con.getResponseCode();

  这里的con是HttpConnection接口的一个实例。变量code的值200表示什么?P6.5,6.6

  1. 请求的资源可用。 2. 请求的资源暂时不可用于指定的URL。

  3. 服务器遇到一个异常错误使其不能完成该请求。

  4. 该请求的指定方法是不可识别的方法。

  25) 下面的代码段在执行时给出错误“java.lang.OutOfMemoryError”:

  StreamConnection connect = null;

  InputStream ins = null;

  StringBuffer buffer = new StringBuffer();

  try

  {

  connect = (StreamConnection)Connector.open(“http://localhost:8000/keyword.txt”);

  ins = connect.openInputStream();

  int i;

  while ((i=ins.read())!= 0)

  {

  if (i!='"n')

  {

  buffer.append((char)i);

  }

  else

  {

  keyVector.addElement(buffer.toString());

  buffer = new StringBuffer();

  }

  }

  }

  确定引起该错误的代码部分。P5.11,5.12

  1. StreamConnection connect = null; 2. InputStream ins = null;

  3. while ((i=ins.read())!= 0); 4. Ins = connect.openInputStream();

  26) 你已创建了一个MIDlet请求位于URL: http://localhost:8000/SchedulerContext/SchedulerAlias的servlet。然而,请求的资源位于一个新的URL:http://localhost:8000/SchedulerContext/Myscheduler.SchedulerAlias。根据上述情况,下列代码段中的整型变量response_code的值是什么?

  HttpConnection conn = MyHttpConnection.connect(url, this );

  display("Connecting to the server..." );

  int response_code = conn.getResponseCode();

  1. 500 2. 307 3. 200 4. 303

  27) 在MIDlet编程中哪一个是允许原始数据类型写的'输出流?P5.7

  1. Writer 2. PrintStream 3. ByteArrayOutputStream 4. DataOutputStream

  28) 一个数据包到达目的端需跨越五个路由器。它将转发多少次?(不确定)

  1. 十 2. 四 3. 六 4. 五

  29) 数据库安全的可寻址(addressable)因素是什么?

  1. 阻止未授权用户访问敏感信息维护数据正确性使授权用户可以访问数据

  2. 保密可用性(Availability)审计 3. 用户识别/验证资源访问控制审计

  4. 访问信息相关问题系统相关问题信息分类

  30) 你正在为一个银行应用程序开发一个MIDlet。当客户向银行发送一个询问时,将显示一个进度指示器直至该请求被处理完。该进度指示器应嵌入在一个窗体组件中。下列哪个方法可以在设备屏幕上显示该进度指示器?

  1. public void showGauge() { Form form = new Form(“Gauge”); Gauge gauge = new Gauge (“Progress”, false, 100, 0); form.append (gauge); Display display = Display.getDisplay(this); display.setCurrent(form); }

  2. public void showGauge() { Gauge gauge = new Gauge (“Progress”, false, 100, 0); Display display = Display.getDisplay(this); display.setCurrent(gauge); }

  3. public void showGauge() { Form form = new Form(“Gauge”); Gauge gauge = new Gauge (“Progress”, false, 100, 0); form.append (gauge); Display.setCurrent(form); }

  4. public void showGauge() { Form form = new Form(“Gauge”); Gauge gauge = new Gauge (“Progress”, false, 100, 0); form.append (gauge); Display display = Display.getCurrent(form); display.setCurrent(gauge); }

  31) 考虑下列关于通用连接框架的优点的陈述:.P5.3

  陈述A:增加了对各种网络协议的支持的一致性。

  陈述B:增加了与标准Java技术的类库的兼容性。

  关于上述陈述哪一个是正确的?

  1. 陈述A正确,陈述B错误。 2. 陈述A错误,陈述B正确。

  3. 两个都正确。 4. 两个都错误。

  32) Dennis是一个系统管理员。他想使用一个复杂的算法以阻挡黑客。下列哪个算法可以最好地满足他的需要?

  1. 802.11 2. RC4 3. WES 4. SSID

  33) 下列哪个方法在RecordEnumeration接口中定义?P7.4

  1. enumerateRecords() 2. getRecord() 3. nextRecord() 4. addRecord()

  34) SaveMyMoney银行为他们的顾客引入了移动银行。一个应用程序使用名为“checks.db”的记录存储。该应用程序使顾客可以方便地存储提交给银行的所有支票的支票号码和日期。记录ID为1的记录需要用新记录替代。你应使用下列哪个代码段来实现该目的?P7.7,7.9

  1. RecordStore rs; rs = RecordStore.openRecordStore(“checks”, true); String st = “1234; 14/06/2002” rs.setRecord ( st, 0, st.length());

  2. RecordStore rs; rs = RecordStore.openRecordStore(“checks”, true); byte[] ba = “1234; 14/06/2002”.getBytes(); rs.setRecord ( ba);

  3. RecordStore rs; rs = RecordStore.openRecordStore(“checks”, true); String st = “1234; 14/06/2002” rs.setRecord ( st);

  4. RecordStore rs; rs = RecordStore.openRecordStore(“checks”, true); byte[] ba = “1234; 14/06/2002”.getBytes(); rs.setRecord ( ba, 0, ba.length);

  35) 在MIDP中定义的异常类列表如下:

  1. InvalidRecordIDException 2. RecordStoreException

  3. ConnectionNotFoundException 4. RecordStoreFullException

  上述异常类中哪些在RMS中定义?P3.5

  1. 1、2、3和4 2. 仅 2和4 3. 1、2和4 4. 2、3和4

【NIIT认证J2ME考试真题「最新」】相关文章:

1.NIIT认证J2ME考试真题

2.NIIT认证面试真题及答案

3.NIIT认证面试真题及答案2017年

4.最新NIIT.Net笔试真题

5.关于NIIT认证考试介绍

6.Photoshop认证考试真题

7.NIIT认证考试怎么样

8.NIIT认证简介