1.class TestSuper { 22.TestSuper(int i) { } 3. } 4.class TestSub extends TestSuper{ } 5.class TestAll { 6.public static void main (String [] args) { 7.new TestSub(); 8.} 9.} Which is true?()
相似题目
-
现有 1. class Calc { 2. public static void main(String [] args) { 3. try { 4. int x = Integer.parselnt ("42a") ; 5. //insert code here 6. System.out.print ("oops"); 7. } 8. } 9. } 下面哪两行分别插入到第五行,会导致输 "oops" ? ()
-
1. class Super { 2. private int a; 3. protected Super(int a) { this.a = a; } 4. } ..... 11. class Sub extends Super { 12. public Sub(int a) { super(a); } 13. public Sub() { this.a= 5; } 14. } Which two, independently, will allow Sub to compile?()
-
1. class Synapse { 2. protected int gap() { return 7; } 3. } 4. 5. class Creb extends Synapse { 6. // insert code here 7. } 分别插入到第 6 行,哪三行可以编译?()
-
现有: 1. class Synapse { 2. protected int gap() { return 7; } 3. } 4. 5. class Creb extends Synapse { 6. // insert code here 7. } 分别插入到第 6 行,哪三行可以编译?()
-
interface A { public int getValue() } class B implements A { public int getValue() { return 1; } } class C extends B { // insert code here } Which three code fragments, inserted individually at line 15, make use of polymorphism?()
-
现有2 个文件: 1. package x; 2. public class X { 3. public static void doX() { System.out.print("doX "); } 4. } 和: 1. class Find { 2. public static void main(String [] args) { 3. //insert code here 4. } 5. } 哪两行分别插入到类Find 的第3 行将编译并产生输出“doX”? ()
-
1. class SuperClass { 2. public a geta() { 3. return new a(); 4. } 5. } 6. class SubClass extends SuperClass { 7. public b geta() { 8. return new b(); 9. } 10. } Which is true?()
-
1. class Calc { 2. public static void main(String [] args) { 3. try { 4. int x = Integer.parseInt("42a"); 5. //insert code here 6. System.out.print("oops "); 7. } 8. } 9. } 下面哪两行分别插入到第五行,会导致输出“oops”?()
-
1. class Super { 2. public float getNum() { return 3.0f; } 3. } 4. 5. public class Sub extends Super { 6. 7. } Which method, placed at line6, causes compilation to fail?()
-
1. class SuperFoo { 2. SuperFoo doStuff(int x) { 3. return new SuperFoo(); 4. } 5. } 6. 7. class Foo extends SuperFoo { 8. //insert code here 9. } 下面哪三项分别插入到第8行,可以编译?()
-
class A { public byte getNumber() { return 1; } } class B extends A { public short getNumber() { return 2; } public static void main(String args[]) { B b = new B(); System.out.println(b.getNumber()); } } What is the result?()
-
现有: 1.class Passer f 2.static final int X=5; 3.public static void main (String [] args) { 4.new Passer().go (x); 5.System. out .print (x); 6. ) 7.void go (int x) { 8.System. out .print(x++); 9.} 10.}结果是什么?()
-
编译并运行以下程序,以下描述哪个选项是正确的( )。1. class A{2. protected String toString(){3. return super.toString();}4. }
-
关于以下程序的说明,正确的是( )1. class StaticStuff2. {3. static int x=10;4. static { x+=5;}5. public static void main(String args[ ])6. {7. System.out.println(\x=\ + x);8. }9. static { x/=3;}10. }
-
在下面程序的第6行补充上下列哪个方法,会导致在编译过程中发生错误?1) class Super{2) public float getNum(){3) return 3.0f;4) }}5) pubhc class Sub extends Super{6)7) }
-
有如下程序: include using namespace std; int i=1; class Fun{ public: static int i; int value{return i—l;} int valueconst{return i+1;} }; int Fun::i=2; int main{ int i=3; Fun funl; const Fun fun2: __________________ return 0; } 若程序的输出结果是: 123 则程序中下画线处遗漏的语句是()。
-
"关于以下程序代码的说明正确的是() 1. class HasStatic{ 2. private static int x=100; 3. public static void main(String args[ ]){ 4. HasStatic hs1=new HasStatic(); 5. hs1.x++; 6. HasStatic hs2=new HasStatic(); 7. hs2.x++; 8. hs1=new HasStatic(); 9. hs1.x++; 10. HasStatic.x- -; 11. System.out.println(""x=""+x); 12. } 13. }
-
12、请执行以下代码,说明错误出现的行数。 1. class Dog(object): 2. def __init__(self,name): 3. self.name = name 4. @property 5. def eat(self): 6. print(" %s is eating" %self.name) 7. 8. d = Dog("wangwang") 9. d.eat() 知识点:属性的定义和使用
推荐题目
- ()是银行从事经营活动必须注入的资金,可以用来吸收银行的经营亏损,缓冲意外损失,保护银行的正常经营,为银行的注册、组织营业以及存款进入前的经营提供启动资金等。
- 简述学前儿童美术教学方法中综合法的特点。
- 当事人为了重复使用而预先拟定,并在订立合同时未与对方协商的条款是( )。
- 各商业银行应当在2011年1月31日前向银监会或其省级派出机构报送资产转表计划,原则上银信合作贷款余额应当按照每季度至少()的比例予以压缩。
- 单行星轮式行星齿轮机构运动特性方程是什么?
- 为什么方便食品受到消费者的欢迎?
- 中国传统文化截止时间为()。
- 上图地貌属于52482d87d3fb9bf8492ccfa28dd27d7f.png
- 下列哪首不是柳永的都市词?
- 社会保障的功能主要有:()。A.防控风险功能