网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
1. abstract class AbstractIt { 2. abstract float getFloat(); 3. } 4. public class AbstractTest extends AbstractIt { 5. private float f1 = 1.0f; 6. private float getFloat() { return f1; } 7. } What is the result?()
A
Compilation succeeds.
B
An exception is thrown.
C
Compilation fails because of an error at line 2.
D
Compilation fails because of an error at line 6.
参考答案
参考解析
解析:
暂无解析
更多 “单选题1. abstract class AbstractIt { 2. abstract float getFloat(); 3. } 4. public class AbstractTest extends AbstractIt { 5. private float f1 = 1.0f; 6. private float getFloat() { return f1; } 7. } What is the result?()A Compilation succeeds.B An exception is thrown.C Compilation fails because of an error at line 2.D Compilation fails because of an error at line 6.” 相关考题
考题
下列程序片段中,能通过编译的是A.public abstract class Animal{ public void speak();}B.public abstract class Animal{ public void speak(){}}C.public class Animal{ public abstract void speak();}D.public abstract class Animal{ public abstract void speak(){}}
考题
下列哪个类声明是正确的? ( )A.abstract final class H1 {...}B.abstract private move(){...}C.protected private numberD.public abstract class Car{...}
考题
下列哪个类声明是正确的?A.abstract class G2 extends superClassl,superClass2{……}B.abstract public class classmates{……}C.public final class NewClass extends superClass implements Interfacel{……}D.public abstract class String{……}
考题
Given:10. interface Data { public void load(); }11. abstract class Info { public abstract void load(); }Which class correctly uses the Data interface and Info class?()()
A.B.C.D.E.F.
考题
如果有-个类MyFrame是Frame的子类,但它不能被实例化,请写出该类的声明头为( )。A.abstract class Frame. extends MyFrameB.abstract class MyFrame. extends FrameC.class MyFrame. abstract extends FrameD.class Frame. abstract extends MyFrame.
考题
下列对类的声明,正确的是( ) BA.abstract final class Hh{…}B.abstract private move(){…}C.protected private number;D.public abstract class Car{…}
考题
如果有一个类MyFrame是Frame的子类,但它不能被实例化,请写出该类的声明头为( )。A.abstract class Frame. extends MyFrameB.abstract class MyFrame. extends FrameC.class MyFrame. abstract extends FrameD.class Frame. abstract extends MyFrame.
考题
下面的代码中有什么错误吗?_______using System;class A{public virtual void F(){Console.WriteLine("A.F");}}abstract class B:A{public abstract override void F();
考题
下列哪个类声明是正确的? ( )A.abstract class G2 extends superClass1,superClass2{...}B.abstract public class classmates{...}C.public final class NewClass extends superClass implemnets Interface1{...}D.public abstract class String{...}
考题
下列程序片段中,能通过编译的是( )。 A.public abstract class Animal{ public void speak;}S
下列程序片段中,能通过编译的是( )。A.public abstract class Animal{ public void speak;}B.public abstract class Animal{ public void speak{);}C.public class Animal{ pubilc abstract void speak;}D.public abstract class Animal{ pubile abstract void speak{};}
考题
下列哪个类声明是正确的? ( )A.abstract class G2 extends superClass1, superClass2 {…}B.abstract public class classmates{…}C.public final class NewClass extends superClass implemnets Interfacel{…}D.public abstract class String{…}
考题
Which declaration prevents creating a subclass of an outer class?()A、 Static class FooBar{}B、 Private class FooBar{}C、 Abstract public class FooBar{}D、 Final public class FooBar{}E、 Final abstract class FooBar{}
考题
1. abstract class AbstractIt { 2. abstract float getFloat(); 3. } 4. public class AbstractTest extends AbstractIt { 5. private float f1 = 1.0f; 6. private float getFloat() { return f1; } 7. } What is the result?() A、 Compilation succeeds.B、 An exception is thrown.C、 Compilation fails because of an error at line 2.D、 Compilation fails because of an error at line 6.
考题
abstract class abstrctIt { abstract float getFloat (); } public class AbstractTest extends AbstractIt { private float f1= 1.0f; private float getFloat () {return f1;} } What is the result? ()A、 Compilation is successful.B、 An error on line 6 causes a runtime failure.C、 An error at line 6 causes compilation to fail.D、 An error at line 2 causes compilation to fail.
考题
下列哪个类的声明是正确的()A、abstract final class HI{}B、abstract private move(){}C、protected private number;D、public abstract class Car{}
考题
下列哪个类声明是正确的()。A、abstract final class H1{…}B、abstract private move(){…}C、protected private number;D、public abstract class Car{…}
考题
下列是抽象类的声明的是()A、 abstract class figure{ }B、 class abstract figure{ }C、 seald class figure{ }D、 static class figure{ }
考题
单选题Which declaration prevents creating a subclass of an outer class?()A
Static class FooBar{}B
Private class FooBar{}C
Abstract public class FooBar{}D
Final public class FooBar{}E
Final abstract class FooBar{}
考题
单选题1. abstract class Color2 { 2. //insert code here 3. } 4. 5. public class Blue2 extends Color2 { 6. public String getRGB() { return "blue"; } 7. } 和4个声明: public abstract String getRGB(); abstract String getRGB(); private abstract String getRGB(); protected abstract String getRGB(); 分别插入到第2行,有多少行可以编译?()A
0B
1C
2D
3
考题
单选题现有: 1. interface Animal { 2. void eat(); 3. } 4. 5. // insert code here 6. 7. public class HouseCat extends Feline { 8. public void eat() { } 9. } 和五个声明: abstract class Feline implements Animal { } abstract class Feline implements Animal { void eat(); } abstract class Feline implements Animal { public void eat(); } abstract class Feline implements Animal { public void eat() { } } abstract class Feline implements Animal { abstract public void eat(); } 分别插入到第5行,有几个可以通过编译?()A
0B
1C
2D
3
考题
多选题1. public class OuterClass { 2. private double d1 = 1.0; 3. // insert code here 4. } Which two are valid if inserted at line 3?()Astatic class InnerOne { public double methoda() { return d1; } }Bstatic class InnerOne { static double methoda() { return d1; } }Cprivate class InnerOne { public double methoda() { return d1; } }Dprotected class InnerOne { static double methoda() { return d1; } }Epublic abstract class InnerOne { public abstract double methoda(); }
考题
单选题1. abstract class AbstractIt { 2. abstract float getFloat(); 3. } 4. public class AbstractTest extends AbstractIt { 5. private float f1 = 1.0f; 6. private float getFloat() { return f1; } 7. } What is the result?()A
Compilation succeeds.B
An exception is thrown.C
Compilation fails because of an error at line 2.D
Compilation fails because of an error at line 6.
考题
单选题abstract class abstrctIt { abstract float getFloat (); } public class AbstractTest extends AbstractIt { private float f1= 1.0f; private float getFloat () {return f1;} } What is the result?()A
Compilation is successful.B
An error on line 6 causes a runtime failure.C
An error at line 6 causes compilation to fail.D
An error at line 2 causes compilation to fail.
考题
单选题现有: 1. abstract class Color2 { 2. //insert code here 3. } 4. 5. public class Blue2 extends Color2 { 6.public String getRGB() { return "blue"; } 7. } 和4个声明: public abstract String getRGB(); abstract String getRGB(); private abstract String getRGB(); protected abstract String getRGB(); 分别插入到第2行,有多少行可以编译?()A
0B
1C
2D
3
考题
单选题现有: interface Animal { void eat () ; } //insert code here public class HouseCat extends Feline { public void eat() { } } 和五个申明 abstract class Feline implements Animal { } abstract class Feline implements Animal { void eat () ; } abstract class Feline implements Animal { public void eat();} abstract class Feline implements Animal { public void eat() {} } abstract class Feline implements Animal { abstract public void eat();} 结果为:()A
1B
2C
3D
4
考题
单选题下列是抽象类的声明的是()A
abstract class figure{ }B
class abstract figure{ }C
seald class figure{ }D
static class figure{ }
热门标签
最新试卷