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’,’ ’); 展开
单选题
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’,’ ’); 展开
展开全部
单选选最后个;
多选
第一题是BC
第二题是BC
第三题是CF
第四题是CDE
都是花时间现做望采纳!
多选
第一题是BC
第二题是BC
第三题是CF
第四题是CDE
都是花时间现做望采纳!
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |