Java 选择题。。。求答案

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++单选题whileonestatementistrue... +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
单选题
while one statement is true
about the code fragment below?
String s=”abcde”;
StringBuffer s1=new
StringBuffer(“abcde”);
If(s.equals(s1))
s1=null;
if(s1.equals(s))
s=null;
Compilation fails at line
1,because the String constructor must be called explicitly.
Compilation fails at line
3,because s and s1have different types.
Compilation succeeds,During
execution,an exception is thrown at line 3.
Compilation succeeds,During
execution,an exception is thrown at line 5.
Compilation succeeds,No
exception is thrown during execution.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
多选题
4. Given:
1.ArrayList a=new ArrayList();
2.a.add(“Alpha”);
3.a.add(“Bravo”);
4.a.add(“Charlie”);
5.a.add(“Delta”)
6.Iterator iter=a.iterator;
Which two ,added at line 7,print the names in the ArrayList in alphabetical order?
A. For (int i=0;i<System.out.println(a.get(i)))
B.For (int i=0;i<a.size();i++)
System.out.println(a[i])
C. While(iter.hasNext())
System.out.println(iter.next());
D. For(int i=0;i<a.size();i++)
System.out.println(iter[i]);
E. For(int i=0;i<a.size();i++)
System.out.println(iter.get(i));
5.1. Public class Test extends Base{
2. public Test(int j ){
3. }
4. public Test(int j,int k){
Super(j,k);
}
}
Which of the following are legitimate calls to construct instances of the Test class(choose two)
A. Test t =new Test();
B.Test t =new Test(1);
C.Test t =new Test(1,2);
D.Test t =new Test(1,2,3);
E.Test t =(new Base()).new Test(1);

6. Given that Thing is a class ,how many objects and reference variables are variables are created by the following code?(choose two)
Thing item,stuff;
Item =new Object();
Thing entity =new Object();
A. One object is created
B.Three objects are created
C.Two objects are created
D.One reference variables is created
E.two reference variables are created
F.three reference variables are created
7. Examine the structure of the EMPLOYEES table;
EMPLOYEE_ID NUMBER Primary Key
FIRST_NAME VARCHAR2(25)
LAST_NAME VARCHAR2(25)
Which three statements insert a row into the table?(choose three)
A. INSERT INTO employees VALUES (NULL ,’John’,’Smith’);
B.INSERT INTO employees(first_name,last_name) VALUES(‘Jone’,’Smith’);
C.INSERT INTO employees VALUES (‘1000’,’John’,NULL);
D.INSERT INTO employees(first_name,last_name,employee_id) VALUES(1000,’John’,’Smith’);
E.INSERT INTO employees(employee_id) VALUES (1000);
F.INSERT INTO employees(first_name,last_name,employee_id)
VALUES(1000,’John’,’ ’);
展开
 我来答
水镜Sahib
2012-08-10 · TA获得超过668个赞
知道小有建树答主
回答量:140
采纳率:100%
帮助的人:117万
展开全部
单选选最后个;
多选
第一题是BC
第二题是BC
第三题是CF
第四题是CDE
都是花时间现做望采纳!
本回答被提问者和网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
忆似血中剑
2012-08-10 · TA获得超过275个赞
知道小有建树答主
回答量:556
采纳率:0%
帮助的人:253万
展开全部
擦,这么多题。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式