OCJP(310-065)

单选题Which can appropriately be thrown by a programmer using Java SE technology to create a desktop application?()A ClassCastExceptionB NullPointerExceptionC NoClassDefFoundErrorD NumberFormatExceptionE ArrayIndexOutOfBoundsException

题目
单选题
Which can appropriately be thrown by a programmer using Java SE technology to create a desktop application?()
A

ClassCastException

B

NullPointerException

C

NoClassDefFoundError

D

NumberFormatException

E

ArrayIndexOutOfBoundsException

参考答案和解析
正确答案: D
解析: 暂无解析
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Java编程语言提供几种预定义的异常,下列是除0异常类型关键字的是 ( )

A.ArithmeticException

B.NullPointerException

C.NegativeArraySizeException

D.ArrayIndexOutOfBoundsException


正确答案:A
解析:在这四个选项中只有A是除0异常类型关键字。选项B中的NullPointerException是调用方法返回的空值没处理或没有初始化变量时抛出的异常。选项C中的NegativeArraySizeException是应用程序试图创建大小为负的数组时抛出的异常。选项D中的ArrayIndexOutOfBoundsException是当一个数组被不合法的索引访问时抛出的异常。

第2题:

Which the two are true regarding a web application class loader?()

  • A、 A web application may override the web container’s implementation classes
  • B、 A web application running in a J2EE product may override classes in the javax.* namespace
  • C、 A web application class loader may NOT override any classes in the java.* and javax.*  namespace
  • D、 Resources in the WAR class directory or in any of the JAR files within the library directory may  be accessed using the J2SE semantics of getResource
  • E、 Resources in the WAR class directory or in any of the JAR files within the library directory  cannot be accessed using the J2SE semantics of getResource

正确答案:C,D

第3题:

Given:Which exception or error will be thrown when a programmer attempts to run this code?()

A.java.lang.StackOverflowError

B.java.lang.IllegalStateException

C.java.lang.ExceptionInInitializerError

D.java.lang.ArrayIndexOutOfBoundsException


参考答案:C

第4题:

A technician installed a new application on a Windows XP desktop. When the technician tries to launch the application it crashes. Which of the following can the technician use to troubleshoot the application?()

  • A、System logs
  • B、Security logs
  • C、Application logs
  • D、Application installation logs

正确答案:C

第5题:

You create Windows Forms applications by using the .NET Framework 3.5.You plan to deploy a new Windows Presentation Foundation (WPF) XAML browser application (XBAP).The deployment must meet the following requirements:  (1)shortcut is added to the Start menu   (2)The most recent version of the application is installed and executed on client computers   (3)Users can uninstall the application from the control panel    You need to identify a deployment technology that meets the specified requirements.You want to achieve this goal by using the minimum amount of development effort. Which deployment technology should you use?()

  • A、XCOPY
  • B、ClickOnce
  • C、MicrosoftWindows Installer
  • D、Remote Desktop connections

正确答案:B

第6题:

When you are designing a Web application, which options define how rich text displays in a browser?()

  • A、"Using HTML"
  • B、"Using Java Applet"
  • C、"Using AJAX Control"
  • D、"Using Best Fit for OS"

正确答案:C

第7题:

Which can appropriately be thrown by a programmer using Java SE technology to create a desktop application?()

  • A、ClassCastException
  • B、NullPointerException
  • C、NoClassDefFoundError
  • D、NumberFormatException
  • E、ArrayIndexOutOfBoundsException

正确答案:D

第8题:

WhichcanappropriatelybethrownbyaprogrammerusingJavaSEtechnologytocreateadesktop application?()

A.ClassCastException

B.NullPointerException

C.NoClassDefFoundError

D.NumberFormatException

E.ArrayIndexOutOfBoundsException


参考答案:D

第9题:

Your web application requires the adding and deleting of many session attributes during a complex usecase. A bug report has come in that indicates that an important session attribute is being deleted too soonand a NullPointerException is being thrown several interactions after the fact. You have decided to create asession event listener that will log when attributes are being deleted so you can track down when theattribute is erroneously being deleted. Which listener class will accomplish this debugging goal?()

  • A、Create an HttpSessionAttributeListener class and implement the attributeDeleted method and log the attribute name using the getName method on the event object.
  • B、Create an HttpSessionAttributeListener class and implement the attributeRemoved method and log the attribute name using the getName method on the event object.
  • C、Create an SessionAttributeListener class and implement the attributeRemoved method and log the attribute name using the getAttributeName method on the event object.
  • D、Create an SessionAttributeListener class and implement the attributeDeleted method and log the attribute name using the getAttributeName method on the event object.

正确答案:B

第10题:

public class Foo {  static int[] a;  static { a[0]=2; }  public static void main( String[] args) {}  }  Which exception or error will be thrown when a programmer attempts to run this code?() 

  • A、 java.lang. StackOverflowError
  • B、 java.lang.IllegalStateException
  • C、 java.lang.ExceptionlnlnitializerError
  • D、 java.lang.ArraylndexOutOfBoundsException

正确答案:C

更多相关问题