此题为判断题(对,错)。
第1题:
下列选项成员变量声明正确的是
A.public protected final int i;
B.abstract class F1{…}
C.private double height;
D.double weight{}
第2题:
下列选项成员变量声明正确的是( )。
A.public protected final int i;
B.abstract class Fl{…}
C.private double height;
D.double weight
第3题:
下列哪个成员方法声明是正确的? ( )
A.public abstract final int f(){...}
B.public static boolean f(){...}
C.static protected void g(a,{...}
D.protected private number;
第4题:
A.final int num1 = 10;
B.static int num2 = 20;
C.abstract int num3 = 30;
D.private int num4 = 40;
第5题:
下列程序的运行结果是______。
include<iostream.h>
class Base
{
public:
virtual void func(int i){cout<<"class Base:"<<i<<end1;)
};
class Derived: public Base
{
public:
void func(double d){cout<<"class Derived:"<<d<<endl;}
};
void main( )
{
Base a,*p=a;
Derived b;
p=&b;
(*p).func(3.3);
}
第6题:
此题为判断题(对,错)。
第7题:
设有程序如下: abstract class absclass { abstract void method1(); } class conclass extends absclass { public void method1() { System.out.println("子类");} } public class mainclass { public static void main(String args[]) { absclass ac1=new absclass(); //语句1 absclass ac2=new conclass(); //语句2 ac2.method1(); //语句3 } } 则main()方法中的第一条语句(即语句1)可以顺利通过编译。()
此题为判断题(对,错)。
第8题:
Which will declare a method that is available to all members of the same package and can be referenced without an instance of the class?()
第9题:
以下声明合法的是()
第10题:
public abstract class Shape { private int x; private int y; public abstract void draw(); public void setAnchor(int x, int y) { this.x = x; this.y = y; } } Which two classes use the Shape class correctly?()
第11题:
Abstract public void methoda();
Public abstract double methoda();
Static void methoda(double d1){}
Public native double methoda() {}
Protected void methoda(double d1) {}
第12题:
Void setVar(float f) {x = f;}
Public void setVar(int f) {x = f;}
Public void setVar(float f) {x = f;}
Public double setVar(float f) {x = f;}
Public final void setVar(float f) {x = f;}
Protected float setVar() {x=3.0f; return 3.0f; }
第13题:
下列成员变量声明中,正确的是______。
A.public protected final int i;
B.abstract class F1{…}
C.private double height;
D.double weight
第14题:
下列哪个成员变量声明是正确的? ( )
A.public protected final iht i;
B.abstract class F9{...}
C.private double height;
D.double weight{}
第15题:
下列程序片段中,能通过编译的是( )。
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{};}
第16题:
下列哪个成员方法声明是正确的? ( )
A.public abstract final int f(){…}
B.public static boolean f(){…}
C.static protected void g(a,b){…}
D.protected private number;
第17题:
此题为判断题(对,错)。
第18题:
此题为判断题(对,错)。
第19题:
此题为判断题(对,错)。
第20题:
Which will declare a method that is available to all members of the same package and be referenced without an instance of the class?()
第21题:
class BaseClass{ private float x= 1.0f; protected void setVar (float f) {x = f;} } class SubClass extends BaseClass { private float x = 2.0f; //insert code here } Which two are valid examples of method overriding?()
第22题:
public class Circle implements Shape { private int radius; }
public abstract class Circle extends Shape { private int radius; }
public class Circle extends Shape { private int radius; public void draw(); }
public abstract class Circle implements Shape { private int radius; public void draw(); }
public class Circle extends Shape { private int radius;public void draw() {/* code here */} }
public abstract class Circle implements Shape { private int radius;public void draw() { / code here */ } }
第23题:
abstract public void methoda ();
public abstract double inethoda ();
static void methoda (double dl) {}
public native double methoda () {}
protected void methoda (double dl) {}