智慧职教: 选项中哪一行代码可以替换题目中//add code here而不产生编译错误?()public abstract class MyClass { public int constInt = 5; //add code here public void method() { } }
举一反三
- 选项中哪一行代码可以替换题目中//add code here而不产生编译错误?() A: public abstract void method(int a); B: constInt = constInt + 5; C: public int method(); D: public abstract void anotherMethod() {}
- 下面选项中哪一行代码可以替换题目中注释语句//add code here不会产生编译错误?()请解释原因?publicabstractclassMyClass {publicintconstInt = 5;//add code herepublicvoidmethod() {}} A: public abstract void method(int a); B: constInt = constInt + 5; C: public int method(); D: public abstract void anotherMethod() {}
- 以下选项可替换题目中的//1而不产生编译错误的是( )。 public abstract class MyClass{ public int constInt = 5; //1 public void method(){ } } A: public abstract void method(int a); B: constInt = constInt + 5; C: public int method(); D: public abstract void anotherMethod();
- 补全以下程序代码public abstract class MyClass { public int constInt = 5; 请在此处补全代码 public void method() { }} A: public abstract void method(int a); B: constInt = constInt + 5; C: public int method(); D: public abstract void anotherMethod() {}
- Which method will complete this class?() A: public int compareTo(Object o){/* more code here */} B: public int compareTo(Score other){/* more code here */} C: public int compare(Score s1, Score s2){/* more code here */} D: public int compare(Object o1, Object o2){/* more code here */}