A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© fso918 黑马帝   /  2011-9-27 10:17  /  1350 人查看  /  2 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

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 编辑 ]

2 个回复

倒序浏览
黑马网友  发表于 2011-9-27 10:18:32
沙发
Answer: 7 BD  8  D  9  A  10  E  11  C

评分

参与人数 1技术分 +1 收起 理由
admin + 1

查看全部评分

回复 使用道具 举报
黑马网友  发表于 2011-9-27 13:44:31
藤椅
7BD   8D     9 D  10B    11 E
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马