• 网络学院
  • IT资讯
  • 操作系统
  • 网络技术
  • 软件应用
  • 办公软件
  • 编程技术
  • 网站架设
  • 数据库类
  • 平面设计
  • 多媒体类
  • 游戏资讯
  • 教学论文
  • 认证考试
SCJP模拟试题[1](2)
  站点:
  • 首 页
  • 最新软件
  • 文章教程
  • 国内软件
  • 国外软件
  • 绿色软件
  • 源码下载
  • 字体下载
SCJP模拟试题[1](2)
软件发布 SCJP模拟试题[1](2)
网络软件 系统工具 应用软件 联络聊天 图形图像 多媒体类 行业软件 游戏娱乐 编程开发 安全相关 教育教学 数码软件 绿软下载
热门软件: QQ 瑞星 pplive e话通 木马克星 千千静听 office2000 五笔字根 Photoshop 视频分割
返回文章教程首页 >> 文章首页 >> 认证考试 >> JAVA认证 >> JAVA题库 >> SCJP模拟试题[1](2)

SCJP模拟试题[1](2)

添加时间: 2007-9-23 1:55:23  作者: JAVA题库  阅读次数:54   来源: http://www.d9soft.com

       

      add(b);
   }
   class ClickHandler extends MouseAdapter {
      public void mouseClicked(MouseEvent evt) {
         // A
      }
   }
}
What line of code at A writes the mouse’s horizontal location to the standard output at the time of the event?

Fill in the blank.
----------------------------
Question 12: Given the same code as in question 10, how can you write a line of code at A that will place the Button object into a variable named mybutton that is already defined to be a reference to a Button object?
 

Fill in the blank.
-----------------------------------------

Question 13: Which Listener interface can you implement to be able to respond to the user hitting the enter key after typing into a TextField object?
 

Fill in the blank.
---------------------------------------
Question 14: What is written to the standard output as the result of executing the following statements?
Boolean b1 = new Boolean(true);
Boolean b2 = new Boolean(true);

if (b1 == b2)
    if (b1.equals(b2))
       System.out.println("a");
    else
       System.out.println("b");
else
   if (b1.equals(b2))
      System.out.println("c");
   else
      System.out.println("d");
Select the one right answer.

a) a

b) b

c) c

d) d


---------------------------------------
Question 15: Which Listener interfaces can you add to a TextArea object?
a) TextListener

b) ActionListener

c) MouseMotionListener

d) MouseListener

e) ComponentListener


-------------------------------------
Question 16: What appears in the standard output if the method named problem() in the code below throws an instance of class Exception when the method named trythis() is invoked?
public void trythis() {

 try {
      System.out.println("1");
      problem();
   } catch (RuntimeException x) {
      System.out.println("2");
      return;
   } catch (Exception x) {
      System.out.println("3");
      return;
   } finally {
      System.out.println("4");
   }
   System.out.println("5");
}
Select all valid answers.

a) "1"

b) "2"

c) "3"

d) "4"

e) "5"

------------------------------------------
Question 17: What is the type of the Event object passed to the mouseDragged() method defined in a class that implements java.awt.event.MouseMotionListener (that is, what is the class name for the argument)?
 

Fill in the blank.


----------------------------------------
Question 18: Examine the following switch block:
char mychar = 'c';
switch (mychar) {
   default:
   case 'a': System.out.println("a"); break;
   case 'b': System.out.println("b"); break;
}
Which of the following questions are definitely true?

Select all valid answers.

a) This switch block is illegal, because only integers can be used in the switch statement.

b) This switch block is fine.

c) This switch block is illegal, because the default statement must come last.

d) When this code runs, nothing is written to the standard output.

e) When this code runs, the letter "a" is written to the standard output.

---------------------------
Question 19: What keyword must appear in a method declaration (followed by the name of the exception) when that method might cause an exception to be thrown and that method does not handle the exception?
 

Fill in the blank.

--------------------------------
Question 20: Which statements accurately describe the following line of code?
Select all valid answers.

String[][] s = new String[10][];
a) This line of code is illegal.

b) s is a two-dimensional array containing 10 rows and 10 columns

c) s is an array of 10 arrays.

d) Each element in s is set to ""

e) Each element in s is uninitialized and must be initialized before it is referenced.

Question 21: What will happen if you try to compile and run the following class?
class Test {
   static int myArg = 1;
   public static void main(String[] args) {
      int myArg;
      System.out.println(myArg);
   }
}
Select the one right answer.

a) This code compiles and displays 0 in the standard output when run.

b) This code compiles and displays 1 in the standard output when run.

c) This code does not compile because you cannot define a local variable named the same as a static variable.

d) This code does not compile because the local variable is used before it is initialized.

--------------------------------------

Question 22: Which declarations for the main() method in a stand-alone program are NOT valid?
Select all valid answers.

a) public static void main()

b) public static void main(String[] string)

c) public static void main(String args)

d) static public int main(String[] args)

e) static void main(String[] args)


---------------------------------------

Question 23: Which of the following identifiers are ILLEGAL?
Select all valid answers.

a) #_pound

b) _underscore

c) 5Interstate

d) Interstate5

e) _5_

--------------------------------------

Question 24: If the user invokes a stand-alone application by typing:
java YourApp 1 2 3
and the main() method defines its String[] parameter as args, how can you access the number 2 using args?

Fill in the blank.


--------------------------------

Question 25: Which interface implementations can you add as listeners for a TextField object?
Select all valid answers.

a) ActionListener

b) FocusListener

c) MouseMotionListener

d) WindowListener

e) ContainerListener
------------------------------------------

Question 26: What must be true for the RunHandler class so that instances of RunHandler can be used as written in the code below:

 

上下文章:

 

上一篇文章: SCJP模拟试题[1](1) 下一篇文章: SCJP模拟试题[1](3)

相关文章:

  • 史上最强的几道oracle面试题
  • 国外公司的Oracle DBA试题
  • 今年4月三级数据库笔试试题及答案
  • Oracle DBA 逻辑备份试题选
  • 国外某公司的Oracle DBA试题

相关软件:

  • 全国计算机等级考试模拟软件(2006年全年使用)二级Visual Basic V9.0
  • 白金模拟炒股平台 V3.6
  • 全国计算机等级考试第21次全真模拟系统 20050311
  • 全国专业技术人员计算机应用能力考试模拟 2.1
  • 中考物理试卷分类试题 4.1
  • 计算机等级考试训练模拟软件(三级网络技术) V1.04

 

快速导航

  • 网络学院
  • 精品汇聚
  • 字体下载
  • 教程下载
  • ASP源码
  • PHP源码
  • Net源码
  • JSP 源码

JAVA认证分类导航

  • JAVA动态
  • JAVA指导
  • JAVA题库

本类经典文章推荐

  • SCJP模拟试题[2](2)
  • SCJP模拟试题[2](1)
  • SCJP考试真题和解析[1](2)
  • SCJP Mock Exam 3(1)
  • SCJP考试题310-025[5](1)
  • Java网络编程之URI、URL研究专题一
  • Java认证模拟题及分析(1)
  • SCJP模拟试题[1](3)
  • Java认证模拟题及分析(3)
  • SCJP考试真题和解析[2](3)

JAVA题库阅读排行

  • SCJP Mock Exam 2(2)
  • JAVA题库:考考你4
  • JAVA题库:考考你2
  • Java认证模拟题及分析(3)
  • SCJP考试真题和解析[1](2)
  • Java认证模拟题及分析(1)
  • JAVA题库:格林模拟试题一(上)(2)
  • SCJP模拟试题[2](3)
  • SCJP模拟试题[2](1)
  • SCJP考试真题和解析[1](1)

JAVA认证阅读总排行

  • SCJP Mock Exam 2(2)
  • JAVA题库:考考你4
  • JAVA题库:考考你2
  • Java认证模拟题及分析(3)
  • SCJP考试真题和解析[1](2)
  • Java认证模拟题及分析(1)
  • JAVA题库:格林模拟试题一(上)(2)
  • SCJP模拟试题[2](3)
  • SCJP模拟试题[2](1)
  • SCJP考试真题和解析[1](1)

广告位置

字母检索 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 回到顶部

关于我们 | 版权声明 | 免责条款 | 广告联系 | 软件发布 | 下载帮助 | 下载排行 | 网站地图 | 特别鸣谢 | 友情连接

copyright; 2005-2008 D9soft.com 第九软件网 版权所有