- 浏览: 180146 次
- 性别:
- 来自: 珠海
最新评论
-
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 3777题目: 引用据说著名犹太历史学家 约瑟夫有过以下的故事: ... -
设置jdk环境变量时lib中的rt.jar ,dt.jar ,tool.jar是什么,作用是什么
2012-08-06 18:21 9185答:dt.jar和tools.jar是两 ... -
ireport 出现 Font '宋体' is not available to the JVM
2012-07-04 16:23 8134运行Ireport报表出现 出现 Font '宋体' is ... -
JDK下目录的作用(转)
2012-01-26 22:43 1105了解JDK安装后的目录结构,对解决一些简单的应用问题很有帮助, ... -
JDK/bin目录下的不同exe文件的用途(转)
2012-01-26 22:29 931新安装完JDk 大家是否发现安装目录的bin文件夹有很多exe ... -
斐波那契数列
2012-01-26 13:16 1045引用 斐波纳契数列(Fibonacci Sequence),又 ... -
汉诺塔 与 递归编程(转自百度百科)
2012-01-26 13:07 1348引用 汉诺塔:汉诺塔 ... -
JSP里request变量列表
2012-01-22 20:58 991HttpSession session=request.get ... -
每个JAVA初学者都应该搞懂的问题!(转)
2012-01-11 11:27 840问题一:我声明了什么! String s = "H ... -
简单的ASE加密解密功能
2012-01-06 13:38 4882import javax.crypto.Cip ... -
String,StringBuffer,StringBuider测试实例(转)
2012-01-04 08:34 1170public class ttssb { / ... -
局部变量初始化问题
2012-01-04 08:31 1136ArrayList arrayList; ... -
Iterator和ListIterator的不同使用方法 (转)
2011-12-31 16:51 1361我们在使用List,Set的时候,为了实现对其数据的遍历,我们 ... -
java中equals和==的区别(转)
2011-12-31 14:47 815值类型是存储在内存中的堆栈(以后简称栈),而引用类型的变量在栈 ... -
循環map(轉)
2011-09-21 13:46 814根据JDK的新特性,用For循环Map,例如循环Map的Key ... -
簡單的文件拷貝
2011-09-06 13:40 915public static boolean c ...
相关推荐
Java 自测试题,适合java自学者的学习检测,也可作为招聘时的练习题
《Java测试题3》 <br>一、 是非题5题(每题3分) 1、 Java是一种计算机语言,更是一种计算机技术。 ( ) 2、 Java支持多继承。 ( ) 3、 接口是特殊的抽象类。 ( ) 4、Java数据库连接用的是ODBC。 ...
java初级语法测试题,
Java 技能测试题Java 技能测试题
java测试题java测试题
Java测试题 用于检测学习效果的一个小测验!
杰普 Core Java测试题 附答案 答案是标准答案,有选择题也有编程题
Java应用程序-题库测试题练习题带答案测试题模拟题自测题.doc
《Java测试题1》 Java培训后考试 一、 是非题5题(每题3分) 1、 对象的特征是对象有状态、行为、标识ID ( ) 2、 GenericServlet是一个与协议相关的Servlet类。 ( ) 3、 Java中的this指的是当前类...
java期末测试题,是各种大学院校复习的资料
第3题 【单选题】【2.00分】【概念理解】 java中用于创建文件对象的类是 [单选题] * JAVA高级程序设计测试题含答案全文共43页,当前为第1页。 A. File(正确答案) B. Object C. Thread D. Frame E. 示例 第4题 【单选...
广州传智播客JavaEE工程师测试题(带答案的).doc 应聘时最漂亮的回答.docx 当面试官问「你有什么要问我的吗」时,应该问什么?.docx 提高 Java 代码性能的各种技巧.docx 搜狗商业平台Java技术实践.docx 最新JAVA...
javacore测试题及参考答案javacore测试题及参考答案
这是我找java软件工程师时候,收集的java面试题,汇集了主要的试题,实际我在笔试中有80%的内容和这里面的是重复的.希望能帮助找java工作的您. EJB方面.doc java.doc Java中文问题详解(高手必读).txt Java中文问题...
包含数据结构绪论,线性表,树,图,查找,排序各章节自测题及详细答案,供在校计算机学生考试复习使用
这是Java基础知识的一套判断题,在学习和复习Java的是时候可以用来进行模拟测试,检测一下自己的能力,用来备考。
键盘录入5个学生信息(姓名,语文成绩,数学成绩,英语成绩),按照总分从高到低输出到控制台java 集合练习题
北大高科java测试题
java 基础 测试题java 基础 测试题java 基础 测试题java 基础 测试题
java基础知识测试题,java基础知识测试题(分享)。