选择题
1:在软件生命周期中,下列哪个说法是不准确的 ?
厂 、开发和运行三个阶段
「C•在开发后期要进行编写代码和软件测试
2:
Which is the most appropriate code sn ippet that can be in serted at line 18 in the follow ing code?
(Assume that the code is compiled and run with assert ions en abled)
import .*;
2.
public class AssertTest
{
private HashMap cctld;
6.
public AssertTest()
8.
{
9.
cctld = new HashMap();
10.
("i n", "In dia");
11.
("uk", "United Kingdom");
12.
("au", "Australia");
13.
// more code...
}
// other methods ....
public String getCountry(String countryCode)
{
// What should be inserted here?
String country = (String)(countryCode);
return country;
}
}
Which is the most appropriate code snippet that can be inserted at line 18 in the following code?
(Assume that the code is compiled and run with assertions enabled)
import .*;
2.
public class AssertTest
{
private HashMap cctld;
6.
7. public AssertTest()
{
cctld = new HashMap();
("in", "India");
("uk", "United Kingdom");
("au", "Australia");
// more code...
}
// other methods ....
16.
17.
18.
19.
20.
21.
22. }
r
public String getCo un try(Stri ng coun tryCode)
{
// What should be in serted here?
String country = (Stri ng)(co un tryCode);
return coun try;
}
assert coun tryCode != n ull;
r
assert coun tryCode != n ull : "Co untry code can not be nu II";
r
assert cctld != n ull : "No country code data is available";
r
assert cctld : "No country code data is available";
3:
Give the follow ing code:
public class Example{
public static void main(String args[] ){
in t l=0;
do{
( "ItCforrlgis: ” +l);
}while(--l>0)
( “ Finish ” );
}
}
Which well be output:
Give the follow ing code:
public class Example{
public static void main(String args[] ){
in t l=0;
do{
( “ Doing it for l is: ” +l);
北京达内科技有限公司Java培训讲师 来自淘豆网m.daumloan.com转载请标明出处.