文档介绍:JAVASE 部分
1、Choose the three valid identifiers from those listed below. (Choose three)?
A. IDoLikeTheLongNameClass B. $byte
C. constD. _ok E. 3_case
2、Which of the following lines of code will compile without error (Choose two)?
A.
int i=0;
if (i) {
(“Hi”);
}
B.
boolean b=true;
boolean b2=true;
if(b= =b2) {
(“So true”);
}
C.
int i=1; int
j=2; if(i= =1||
j= =2)
(“OK”);
D.
int i=1;
int j=2;
if (i==1 &| j==2)
(“OK”);
3、Which two demonstrate a "has a" relationship(Choose two)?
A. public interface Person { }
public class Employee extends Person{ }
B. public interface Shape { }
public interface Rectandle extends Shape { }
C. public interface Colorable { }
public class Shape implements Colorable
{ }
D. public class Species{ }
public class Animal{private Species species;}
E. interface Component{ }
class Container implements Component{
private Component[] children;
}
4、What will happen when you attempt to compile and run the following code?
public class Static{
static {
int x = 5;
}
static int x,y;
public static void main(String args[]){
x--;
myMethod();
(x + y + ++x);
}
public static void myMethod(){
y = x+++++x;
}
}
error : 1 : 2
: 3 : 7 : 8
5 、 What is the correct ordering for the import, class and package declarations when found in a single file?
A. package, import, classB. class, import, packageC. import, package, classD. package, class, import
6、What will happen when you attempt to compile and run the following code.
public class Pvf{
static boolean Paddy;
public static void main(String
argv[]){ (Paddy);
}
}
A. Compile time error B. compilation and output of false
C. compilation and output of true D. compilation and output of null
7、Given the folowing classes whic