- 浏览: 182584 次
- 性别:
- 来自: 珠海
最新评论
-
univasity:
点个赞!
解決BufferedReader读取UTF-8文件中文乱码(转) -
xiaoshuai2233:
帮大忙啦
解決BufferedReader读取UTF-8文件中文乱码(转) -
u010100704:
Exception in thread "main& ...
使用POI向Excel中插入多張图片 -
06softwaregaojie:
ie6下怎么不行呢,仍然给出提示
让window.close不提示:您查看的网页正在试图关闭窗口(转) -
sagittarius7:
这个解决了困扰了我一下午的问题啊,之前我还一直是在另外一个方向 ...
解決BufferedReader读取UTF-8文件中文乱码(转)
Which statement is true about the grid bag layout manager?
A. The number of rows and columns is fixed when the container is created.
B. The number of rows and columns is fixed when the GridBagLayout object is
created.
C. If a component has a fill value of BOTH, then as the container change size, the
component is resized.
D. Every component must carry a non-zero weightx and weighty value when it is added
to the container
E. If a row has a weighty value that is non-zero, then as the container changes
height, the row changes height.
请选择: A B C D E
答案:C
Consider the following code: What will be printed?
public class Arg{
String [] MyArg;
public static void main(String arg[]){
MyArg[] = arg[];
}
public void amethod(){
System.out.println(arg[1]);
}
}
A. null
B. 0
C. Nothing will be printed. Compilation error.
D. Compiles just fine, but a RuntimeException will be thrown.
请选择: A B C D
答案:C
Consider the code fragment below:
outer: for(int i = 0; i < 2; i++){
inner: for(int j = 0; j < 2; j++){
if(j==1)
break outer;
System.out.println("i = " + i ", j = " + j);
}
}
Which of the following will be printed to standard output?
A. i = 0, j = 0
B. i = 1, j = 0
C. i = 2, j = 0
D. i = 0, j = 1
E. i = 1, j = 1
F. i = 2, j = 1
请选择: A B C D E F
答案:A
What access control keyword should you use to enable other classes to access a
method freely within its package, but to restrict classes outside of the package
from accessing that method? Select all valid answers.
a. private
b. public
c. protected
d. Do not supply an access control keyword (friendly).
请选择: A B C D
答案:D
1) interface Foo{
2) int k=0;
3) }
4) public class Test implements Foo{
5) public static void main(String args[]){
6) int i;
7) Test test =new Test();
i=test.k;
9) i=Test.k;
10) i=Foo.k;
11) }
12) }
What is the result?
A. Compilation succeeds.
B. An error at line 2 causes compilation to fail.
C. An error at line 9 causes compilation to fail.
D. An error at line 10 causes compilation to fail.
E. An error at line 11 causes compilation to fail.
What will happen when you attempt to compile and run this code?
class Test{
abstract public void myfunc();
public void another(){
System.out.println("Another method");
}
}
public class Abs extends Test{
public static void main(String argv[]){
Abs a=new Abs();
a.amethod();
}
public void myfunc(){
System.out.println("My func");
}
public void amethod(){
myfunc();
}
}
Select the one right answer.
A.The code will compile and run,printing out the words"My Func"
B.The compiler will complain that the Test class is not declared as abstract methods.
C.The code will compile but complain at run time that Test class has non
abstract methods.
D.The compiler will complain that the method myfunc int the base class has no
body,nobody at all to looove it
请选择: A B C D
答案:B
点评:当类中存在一个以上的抽象方法时,该类必须被声明为抽象类,否则会发生编译错误。在本例中
,由于基类Test存在一个抽象的方法myfunc(),而该基类没有被声明为抽象类,所以在编译时产生
错误.
What will happen when you attempt to compile and run this code?
class Test{
abstract public void myfunc();
public void another(){
System.out.println("Another method");
}
}
public class Abs extends Test{
public static void main(String argv[]){
Abs a=new Abs();
a.amethod();
}
public void myfunc(){
System.out.println("My func");
}
public void amethod(){
myfunc();
}
}
Select the one right answer.
A.The code will compile and run,printing out the words"My Func"
B.The compiler will complain that the Test class is not declared as abstract methods.
C.The code will compile but complain at run time that Test class has non
abstract methods.
D.The compiler will complain that the method myfunc int the base class has no
body,nobody at all to looove it
请选择: A B C D
答案:B
点评:当类中存在一个以上的抽象方法时,该类必须被声明为抽象类,否则会发生编译错误。在本例中
,由于基类Test存在一个抽象的方法myfunc(),而该基类没有被声明为抽象类,所以在编译时产生
错误.
String foo="blue";
boolean[] bar=new boolean[1];
if(bar[0]){
foo="green";
}
what is the value of foo?
A."" B.null C.blue D.green
请选择: A B C D
答案:C
Given the following class:
public class Sample{
long length;
public Sample(long l){ length = l; }
public static void main(String arg[]){
Sample s1, s2, s3;
s1 = new Sample(21L);
s2 = new Sample(21L);
s3 = s2;
long m = 21L;
}
}
Which expression returns true?
A. s1 == s2;
B. s2 == s3;
C. m == s1;
D. s1.equals(m).
请选择: A B C D
答案:B
点评:==操作符两边的操作数必须是同一类型的(可以是父子类之间)才能编译通过。
A public member vairable called MAX_LENGTH which is int type, the value of the variable
remains constant value 100. Use a short statement to define the variable.
A. public int MAX_LENGTH=100;
B. final int MAX_LENGTH=100;
C. final public int MAX_LENGTH=100;
D. public final int MAX_LENGTH=100.
请选择: A B C D
答案:D
点评: Java中共有变量使用public定义,常量变量使用final,另外注意的是修饰符的顺序,一个最完整的修饰是public static final int varial_a=100;这个顺序不能错,这和c++中也是不同的。而答案c恰恰错在修饰符的顺序上。
What can you place first in this file?
//What can you put here?
public class Apa{}
A. class a implements Apa
B. protected class B {}
C. private abstract class{}
D. import java.awt.*;
E. package dum.util;
F. private int super = 1000;
请选择: A B C D E
答案:A D E
import java.awt.*;
public class X extends Frame{
public static void main(String[] args){
X x=new X();
x.pack();
x.setVisible(true);
}
public X(){
setLayout(new BorderLayout());
Panel p=new Panel();
add(p,BorderLayout.NORTH);
Button b=new Button("North");
p.add(b);
Button b1=new Button("South");
add(b1,BorderLayout.SOUTH);
}
which two are true?
A. The button labeled "North" and "South" will have the same width
B. The button labeled "North" and "South" will have the same height
C. The height of the button labeled "North" can vary if the Frame is resized
D. The height of the button labeled "South" can vary if the Frame is resized
E. The width of the button labeled "North" is constant even if the Frame is
resized
F. The width of the button labeled "South" is constant even if the Frame is
resized
请选择: A B C D E F
答案:B E
A. The number of rows and columns is fixed when the container is created.
B. The number of rows and columns is fixed when the GridBagLayout object is
created.
C. If a component has a fill value of BOTH, then as the container change size, the
component is resized.
D. Every component must carry a non-zero weightx and weighty value when it is added
to the container
E. If a row has a weighty value that is non-zero, then as the container changes
height, the row changes height.
请选择: A B C D E
答案:C
Consider the following code: What will be printed?
public class Arg{
String [] MyArg;
public static void main(String arg[]){
MyArg[] = arg[];
}
public void amethod(){
System.out.println(arg[1]);
}
}
A. null
B. 0
C. Nothing will be printed. Compilation error.
D. Compiles just fine, but a RuntimeException will be thrown.
请选择: A B C D
答案:C
Consider the code fragment below:
outer: for(int i = 0; i < 2; i++){
inner: for(int j = 0; j < 2; j++){
if(j==1)
break outer;
System.out.println("i = " + i ", j = " + j);
}
}
Which of the following will be printed to standard output?
A. i = 0, j = 0
B. i = 1, j = 0
C. i = 2, j = 0
D. i = 0, j = 1
E. i = 1, j = 1
F. i = 2, j = 1
请选择: A B C D E F
答案:A
What access control keyword should you use to enable other classes to access a
method freely within its package, but to restrict classes outside of the package
from accessing that method? Select all valid answers.
a. private
b. public
c. protected
d. Do not supply an access control keyword (friendly).
请选择: A B C D
答案:D
1) interface Foo{
2) int k=0;
3) }
4) public class Test implements Foo{
5) public static void main(String args[]){
6) int i;
7) Test test =new Test();
i=test.k;
9) i=Test.k;
10) i=Foo.k;
11) }
12) }
What is the result?
A. Compilation succeeds.
B. An error at line 2 causes compilation to fail.
C. An error at line 9 causes compilation to fail.
D. An error at line 10 causes compilation to fail.
E. An error at line 11 causes compilation to fail.
What will happen when you attempt to compile and run this code?
class Test{
abstract public void myfunc();
public void another(){
System.out.println("Another method");
}
}
public class Abs extends Test{
public static void main(String argv[]){
Abs a=new Abs();
a.amethod();
}
public void myfunc(){
System.out.println("My func");
}
public void amethod(){
myfunc();
}
}
Select the one right answer.
A.The code will compile and run,printing out the words"My Func"
B.The compiler will complain that the Test class is not declared as abstract methods.
C.The code will compile but complain at run time that Test class has non
abstract methods.
D.The compiler will complain that the method myfunc int the base class has no
body,nobody at all to looove it
请选择: A B C D
答案:B
点评:当类中存在一个以上的抽象方法时,该类必须被声明为抽象类,否则会发生编译错误。在本例中
,由于基类Test存在一个抽象的方法myfunc(),而该基类没有被声明为抽象类,所以在编译时产生
错误.
What will happen when you attempt to compile and run this code?
class Test{
abstract public void myfunc();
public void another(){
System.out.println("Another method");
}
}
public class Abs extends Test{
public static void main(String argv[]){
Abs a=new Abs();
a.amethod();
}
public void myfunc(){
System.out.println("My func");
}
public void amethod(){
myfunc();
}
}
Select the one right answer.
A.The code will compile and run,printing out the words"My Func"
B.The compiler will complain that the Test class is not declared as abstract methods.
C.The code will compile but complain at run time that Test class has non
abstract methods.
D.The compiler will complain that the method myfunc int the base class has no
body,nobody at all to looove it
请选择: A B C D
答案:B
点评:当类中存在一个以上的抽象方法时,该类必须被声明为抽象类,否则会发生编译错误。在本例中
,由于基类Test存在一个抽象的方法myfunc(),而该基类没有被声明为抽象类,所以在编译时产生
错误.
String foo="blue";
boolean[] bar=new boolean[1];
if(bar[0]){
foo="green";
}
what is the value of foo?
A."" B.null C.blue D.green
请选择: A B C D
答案:C
Given the following class:
public class Sample{
long length;
public Sample(long l){ length = l; }
public static void main(String arg[]){
Sample s1, s2, s3;
s1 = new Sample(21L);
s2 = new Sample(21L);
s3 = s2;
long m = 21L;
}
}
Which expression returns true?
A. s1 == s2;
B. s2 == s3;
C. m == s1;
D. s1.equals(m).
请选择: A B C D
答案:B
点评:==操作符两边的操作数必须是同一类型的(可以是父子类之间)才能编译通过。
A public member vairable called MAX_LENGTH which is int type, the value of the variable
remains constant value 100. Use a short statement to define the variable.
A. public int MAX_LENGTH=100;
B. final int MAX_LENGTH=100;
C. final public int MAX_LENGTH=100;
D. public final int MAX_LENGTH=100.
请选择: A B C D
答案:D
点评: Java中共有变量使用public定义,常量变量使用final,另外注意的是修饰符的顺序,一个最完整的修饰是public static final int varial_a=100;这个顺序不能错,这和c++中也是不同的。而答案c恰恰错在修饰符的顺序上。
What can you place first in this file?
//What can you put here?
public class Apa{}
A. class a implements Apa
B. protected class B {}
C. private abstract class{}
D. import java.awt.*;
E. package dum.util;
F. private int super = 1000;
请选择: A B C D E
答案:A D E
import java.awt.*;
public class X extends Frame{
public static void main(String[] args){
X x=new X();
x.pack();
x.setVisible(true);
}
public X(){
setLayout(new BorderLayout());
Panel p=new Panel();
add(p,BorderLayout.NORTH);
Button b=new Button("North");
p.add(b);
Button b1=new Button("South");
add(b1,BorderLayout.SOUTH);
}
which two are true?
A. The button labeled "North" and "South" will have the same width
B. The button labeled "North" and "South" will have the same height
C. The height of the button labeled "North" can vary if the Frame is resized
D. The height of the button labeled "South" can vary if the Frame is resized
E. The width of the button labeled "North" is constant even if the Frame is
resized
F. The width of the button labeled "South" is constant even if the Frame is
resized
请选择: A B C D E F
答案:B E
发表评论
-
约瑟夫环的java实现
2013-05-17 10:40 3815题目: 引用据说著名犹太历史学家 约瑟夫有过以下的故事: ... -
设置jdk环境变量时lib中的rt.jar ,dt.jar ,tool.jar是什么,作用是什么
2012-08-06 18:21 9236答:dt.jar和tools.jar是两 ... -
ireport 出现 Font '宋体' is not available to the JVM
2012-07-04 16:23 8400运行Ireport报表出现 出现 Font '宋体' is ... -
JDK下目录的作用(转)
2012-01-26 22:43 1133了解JDK安装后的目录结构,对解决一些简单的应用问题很有帮助, ... -
JDK/bin目录下的不同exe文件的用途(转)
2012-01-26 22:29 963新安装完JDk 大家是否发现安装目录的bin文件夹有很多exe ... -
斐波那契数列
2012-01-26 13:16 1078引用 斐波纳契数列(Fibonacci Sequence),又 ... -
汉诺塔 与 递归编程(转自百度百科)
2012-01-26 13:07 1377引用 汉诺塔:汉诺塔 ... -
JSP里request变量列表
2012-01-22 20:58 1015HttpSession session=request.get ... -
每个JAVA初学者都应该搞懂的问题!(转)
2012-01-11 11:27 874问题一:我声明了什么! String s = "H ... -
简单的ASE加密解密功能
2012-01-06 13:38 4926import javax.crypto.Cip ... -
String,StringBuffer,StringBuider测试实例(转)
2012-01-04 08:34 1207public class ttssb { / ... -
局部变量初始化问题
2012-01-04 08:31 1167ArrayList arrayList; ... -
Iterator和ListIterator的不同使用方法 (转)
2011-12-31 16:51 1396我们在使用List,Set的时候,为了实现对其数据的遍历,我们 ... -
java中equals和==的区别(转)
2011-12-31 14:47 852值类型是存储在内存中的堆栈(以后简称栈),而引用类型的变量在栈 ... -
循環map(轉)
2011-09-21 13:46 850根据JDK的新特性,用For循环Map,例如循环Map的Key ... -
簡單的文件拷貝
2011-09-06 13:40 948public static boolean c ...
相关推荐
2. "~$va笔试题常见英语.doc" 提到了笔试题,这可能是面试或招聘过程中的Java测试题目,其中可能包含了一些与Java测试相关的英文术语或概念。 3. "SCWCD Exam Study(updated).pdf" SCWCD代表Sun Certified Web ...
【标题】北大青鸟Y2Java结业测试题 包含源码 这是一份针对北大青鸟Y2阶段Java学员的结业测试题,它旨在检验学员在学习完这一阶段课程后对Java编程语言的理解程度和应用能力。这份测试题不仅包含了一系列问题,还...
本套自测题集是专为Java编程语言设计的,涵盖了数据结构的基础到高级主题,适合计算机专业的在校学生进行考试复习。以下是各章自测题及详细答案的概述: 1. **数据结构绪论**: 这一部分通常会介绍数据结构的基本...
【北大青鸟S1 JAVA 选择题50题内部测试】是北大青鸟教育机构为学员准备的一套Java编程语言的精选选择题集,旨在帮助学员巩固和检验S1阶段的学习成果。这套试题涵盖了一小时的限时测试,旨在锻炼学员在实际考试环境中...
Java测试题 用于检测学习效果的一个小测验!
【Java题库测试】是一个关于Java编程语言的学习资源集合,主要涵盖了各种编程题目,旨在帮助开发者提升Java技术能力。这个题库可能包含了多种类型的题目,如基础语法、面向对象、集合框架、多线程、网络编程、IO流、...
广州传智播客JavaEE工程师测试题(带答案的).doc 应聘时最漂亮的回答.docx 当面试官问「你有什么要问我的吗」时,应该问什么?.docx 提高 Java 代码性能的各种技巧.docx 搜狗商业平台Java技术实践.docx 最新JAVA...
这些面试题通常用于测试开发者对Java基础知识的掌握程度。理解JDK与JRE的区别可以帮助开发者理解开发环境和运行环境的不同需求,而`==`和`equals`的使用则涉及到对Java内存模型的理解,这是编写正确、健壮的Java代码...
Java 测试系统是一种基于Java编程语言开发的软件应用,主要用于进行选择题类型的在线测试。这样的系统通常包含多项功能,如题目库管理、用户界面、答题逻辑以及结果评估等。在这个项目中,我们可以从以下几个关键...
这份"JAVA基础测试题(含答案)"的压缩包显然旨在帮助学习者检验和巩固他们的Java基础知识。让我们一起探讨这些测试题可能涵盖的知识点,以及这些知识点在实际编程中的重要性。 1. **Java语法基础**:测试题可能会...
广州传智播客JavaEE工程师测试题(带答案的).doc 应聘时最漂亮的回答.docx 当面试官问「你有什么要问我的吗」时,应该问什么?.docx 提高 Java 代码性能的各种技巧.docx 搜狗商业平台Java技术实践.docx 最新JAVA...
"Java 程序设计期中考试测试题含答案" 本文档提供了 Java 程序设计期中考试测试题,包括选择题、填空题和编程题。测试题涵盖了 Java 基础知识点,包括 Java 源程序编译、变量、数据类型、运算符、控制语句、方法、...
Java应用程序-题库测试题练习题带答案测试题模拟题自测题.doc
Java 技能测试题主要涵盖了三个核心领域:线程、Socket和I/O以及算法和数据库操作。这些知识点在Java编程中至关重要,对于软件工程师的角色尤其重要。以下是对这些知识点的详细解释: 1. **线程**: 线程是程序中...
"Java 面试题及其答案.doc"和"JAVA面试题.doc"提供了大量的面试题及解答,涵盖了从基础知识到高级特性的广泛范围,包括反射、注解、设计模式、Spring框架、数据库操作等。通过这些题目,求职者可以自我评估,了解...
Java课程期末测试题通常涵盖了Java语言的基础概念、核心特性、面向对象编程、异常处理、集合框架、多线程、输入/输出(I/O)系统、网络编程、数据库连接(JDBC)以及一些高级主题如反射、注解和Java Swing图形用户界面等...
Java自测题是一种高效的学习和复习工具,尤其对于准备Sun认证考试(现在称为Oracle Certified Professional, Java SE 8 Programmer)的学员来说,它提供了一种检验自身编程技能和理论知识的方式。Sun认证是Java...