Q7
Given :
class A{
A(){}
}
class B extends A{
}
Which two statements are true?(choose two)
A Class B's constructor is public .
B Class B's constructor is no arguments.
C Class B's constructor includes a call to this().
D Class B's constructor includes a call to super().
Q8
Given:
int i = 1 , j = 10;
do{
if(i>j){
break;
}
j--;
while(++i < 5);
System.out.println("i ="+i+"and j ="+j);
What is the result?
A i = 6 and j = 5.
B i = 5 and j = 5.
C i = 6 and j = 4.
D i = 5 and j = 6,
E i = 6 and j = 6.
Q9
About assertion:
Which statement is true?
A Assertions can be enabled or disabled on a class-by-class basis.
B Conditional conpilation is used to allow tested classes to tun at full speed.
C Assertions are appropriate for cheeching the validity of arguments in a method.
D The programmer can choose to excute a return statement or to throw an exception if an assertion fail.
Q 10
You want a class to have access to members of another class in the same package .Which is the most restrictive access that accomplisnes this objective?
A public
B private
C protected
D transient
E default access
Q11
Given
int x = 3;
int y = 1;
if( x=y){
System.out.println("x = "+x);
}
Which is the result?
A x = 1;
B x = 3;
C Compilation fails.
D The code runs with no out put.
E An exception is thrown at runtime.
[ 本帖最后由 fso918 于 2011-09-27 11:30 编辑 ] |
|