只在第11行
在第8行和第11行
在第5行、第8行和第11行
在第2行、第5行、第8行和第11行
第1题:
1. public class Target { 2. private int i = 0; 3. public int addOne() { 4. return ++i; 5. } 6. } And: 1. public class Client { 2. public static void main(String[] args) { 3. System.out.println(new Target().addOne()); 4. } 5. } Which change can you make to Target without affecting Client?()
第2题:
1. public class A { 2. void A() { 3. System.out.println(“Class A”); 4. } 5. public static void main(String[] args) { 6. new A(); 7. } 8. } What is the result?()
第3题:
现有: 1. class Propeller2 { 2. pulolic static void main (String[]args)//add code here? 3. { new Propeller2().topGo(); } 4. 5.void topGo() //add code here? 6. { middleGo(); } 7. 8.void middleGo() //add code here? 9. { go(); System.out.println ("late middle"); } void go() //add code here? 12. {throw new Exception(); } 13. } 为使代码通过编译,需要在哪一行加入声明throws Exception?()
第4题:
现有: class TestApp{ public static void main (String[] args){ for (int i=0; i
第5题:
现有: class TestA { public void start() { System.out.println("TestA"); } } public class TestB extends TestA { public void start() { System.out.println("TestB"); } public static void main (string[] args) ( ((TestA)new TestB()).start(); ) } 运行结果是哪项?()
第6题:
public void main(String args[])
public void static main(String args[])
public static main(String[] argv)
final public static void main(String [] array)
public static void main(String args[])
第7题:
process(bytes);
BitUtils.process(bytes);
util.BitUtils.process(bytes);
SomeApp cannot use methods in BitUtils.
import util.BitUtils.*; process(bytes);
第8题:
public static void main(String[]args)
public static void main(String[]x)
public static void main(Stringargs[])
public void main(String[]args)
第9题:
chirp chirp
chirp hello
hello hello
编译失败
第10题:
Class A
Compilation fails.
An exception is thrown at line 2.
An exception is thrown at line 6.
The code executes with no output.
第11题:
public static void main(String[] args){}
public static void main(){}
public static void main(String args[]){}
public void static main(String[] args){}
第12题:
0123
012456789
0123456789
012
第13题:
Which declarations will allow a class to be started as a standalone program?()
第14题:
Public class test ( Public static void main (String args[]) ( System.out.printIn (6 ^ 3); ) ) What is the output?()
第15题:
下列有关main()方法的签名正确的是哪些?()
第16题:
现有: class Top { static int x=l; public Top (inty) { x*=3; } } class Middle extends Top { public Middle() {x+=1; ) public static void main (String [] args) { Middle m = new Middle(); System. out .println (x); } } 结果为:()
第17题:
下面哪些main方法可用于程序执行()
第18题:
doX();
X.doX();
x.X.doX();
x.X myX = new x.X(); myX.doX();
第19题:
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.
第20题:
55
56
65
66
第21题:
TeStA
TeStB
编译失败
运行时抛出异常
第22题:
7
5
3
2
第23题:
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;