s2
sl
s2和s3
s2和s4
s2, s3和s4
sl. s2. s3和s4
第1题:
现有: 1. import java.util.*; 2. class AddStuff { 3.public static void main (String [] args) { 4.TreeSet
第2题:
现有如下包结构: com |-- x | |-- Alpha.class | | | |-- y | |-- Beta.class | |-- Gamma.class 和类: class Test { Alpha a; Beta b; Gamma c; } 哪三个必须加入到类 Test 中,以使其通过编译?()
第3题:
与page指令<%@ page import= “java.util.*, java.text.* “ %> 等价的是()。
第4题:
现有: import java.util.*; class AddStuff2 { public static void main(String [] args) { TreeSet
第5题:
现有: 1. import java.util.*; 2. class ForInTest { 3.static List list - new ArrayList(): 4. 5.static List getList() { return list; } 6. 7.public static void main (Strincj[] args) { 8.list.add("a"); list.add("b"); list.add("c"); 9. //insert code here 10. System.out.print (o); 11. } 12. } 第9行插入哪一项将输出abc?()
第6题:
1. import java.util.*; 2. public class Example { 3. public static void main(String[] args) { 4. // insert code here 5. set.add(new integer(2)); 6. set.add(new integer(l)); 7. System.out.println(set); 8. } 9. } Which code, inserted at line 4, guarantees that this program will output [1,2]? ()
第7题:
package,import,class
class,import,package
import,package,class
package,class,import
第8题:
process(bytes);
BitUtils.process(bytes);
util.BitUtils.process(bytes);
SomeApp cannot use methods in BitUtils.
import util.BitUtils.*; process(bytes);
第9题:
<%@ import="“java.util.*" page=""><%@ import="“java.text.*" page=""><%@ import="“java.text.*" page=""><%@ import="“java.util.*" page=""><%@ import="“java.text.*" page=""><%@ import="“java.util.*" page=""><%@ page import= “java.util.* %> <%@ page import= “java.text.* “ %>
<%@ page import= “java.util.*” , import= “java.text.* “ %>
<%@ page import= “java.util.* “ ; %> <%@ page import= “java.text.* “ ; %>
<%@ page import= “java.util.* ; java.text.* “ %>
第10题:
Map c= new SortedMap();
HashMap c= new HashMap();
HashMap c= new Hashtalole();
SortedMap c= new TreeMap();
ArrayList c= new ArrayList();
MaD c = new LinkedHashMap();
第11题:
〈jsp:include file=”java.util.*” /〉
〈jsp:include page=”java.util.*” /〉
〈%@ page import=”java.util.*” %〉
〈%@ page include=”java.util.*” %〉
第12题:
import utils.*;
static import utils.*;
import utils.Repetition.*;
static import utils.Repetition. *;
import utils.Repetition.twice();
import static utils.Repetition.twice;
static import utils.Repetition.twice;
第13题:
Given a file GrizzlyBear.java: 1. package animals.mammals; 2. 3. public class GrizzlyBear extends Bear { 4. void hunt() { 5. Salmon s = findSalmon(); 6. s.consume(); 7. } 8. } and another file, Salmon.java: 1. package animals.fish; 2. 3. public class Salmon extends Fish { 4. void consume() { /* do stuff */ } 5. } Assume both classes are defined in the correct directories for theft packages, and that the Mammal class correctly defines the findSalmon() method. Which two changes allow this code to compile correctly?()
第14题:
在单一文件中import、class和package的正确出现顺序是()
第15题:
定义Java.Applet程序时,必须有的import语句是()。
第16题:
现有: import java.util.*; class ScanStuff { public static void main (String [] args) { String S= "x,yy,123"; Scanner sc = new Scanner (s); while (sc.hasNext()) System.out.print (sc.next() +" "); } } 结果是什么?()
第17题:
Given a class Repetition: 1.package utils; 2. 3.public class Repetition{ 4.public static String twice(Strings){returns+s;} 5.} and given another class Demo: 1.//insert code here2. 3.public class Demo{ 4.public static void main(String[]args){ 5.System.out.println(twice("pizza")); 6.} 7.} Which code should be inserted at line 1 of Demo.java to compile and run Demo to print“pizzapizza”?()
第18题:
1. import java.util.*; 2. 3. Class FindStuff { 4. public static void main(String [] args) { 5. // insert code here 6. c.put("x", 123); 7. } 8. } 分别插入到第5行,哪三行允许代码编译?()
第19题:
String s = strings.get(0);
Iterator i1 = strings.iterator();
String[] array1 = strings.toArray();
Iterator
String[] array2 = strings.toArray(new String[1]);
Iterator
第20题:
process(bytes);
BitUtils.process(bytes);
app.BitUtils.process(bytes);
util.BitUtils.process(bytes);
import util.BitUtils. *; process(bytes);
SomeApp cannot use the process method in BitUtils.
第21题:
for(char o: list)
for(Object o: getList())
for(Object o: getList();)
for(Object o: o.getList())
第22题:
s1
s2
s2 和 s3
s2 和 s4
第23题:
one
one three two
one two three
one two three four
four one three two
编译失败
第24题:
x yy
x,yy,123
x yy 123
x,yy
编译失败
运行的时候有异常抛出