对于下列代码,叙述正确的是()。 interface Com{ int MAX=100; public void stop(); protected void start(); abstract void pause(); }
A.int MAX=100; 会导致编译出错。
B.public void stop(); 会导致编译出错。
C.protected void start(); 会导致编译出错。
D.abstract void pause(); 会导致编译出错。
第1题:
下列______选项不是InputStream类中的方法。
A.public abstract int read() throws IOException
B.public final void writeInt (int V)throws IOException
C.public int available() throws IOException
D.public void close() throws IOException
第2题:
下列哪个成员方法声明是正确的? ( )
A.public abstract final int f(){...}
B.public static boolean f(){...}
C.static protected void g(a,{...}
D.protected private number;
第3题:
下列哪个成员方法声明是正确的? ( )
A.public abstract final int f(){…}
B.public static boolean f(){…}
C.static protected void g(a,b){…}
D.protected private number;
第4题:
Which will declare a method that is available to all members of the same package and be referenced without an instance of the class?()
第5题:
interface Data { public void load(); } abstract class Info { public abstract void load(); } Which class correctly uses the Data interface and Info class?()
第6题:
Object类的finalize()方法是如何声明的()。
第7题:
Given the following interface definition, which definitions are valid?() interface I { void setValue(int val); int getValue(); } DEFINITION a: (a) class a extends I { int value; void setValue(int val) { value = val; } int getValue() { return value; } } DEFINITION b: (b) interface b extends I { void increment(); } DEFINITION c: (c) abstract class c implements I { int getValue() { return 0; } abstract void increment(); } DEFINITION d: (d) interface d implements I { void increment(); } DEFINITION e: (e) class e implements I { int value; public void setValue(int val) { value = val; } }
第8题:
现有: interface Data {public void load();} abstract class Info {public abstract void load();} 下列类定义中正确使用Data和Info的是哪项?()
第9题:
void run()
public void run()
public void start()
void run(int priority)
public void run(int priority)
public void start(int priority)
第10题:
public class Employee extends Info implements Data { public void load() { /*do something*/ } }
public class Employee implements Info extends Data { public void load() { /*do something*/ } }
public class Employee extends Info implements Data { public void load() { /*do something */ } public void Info.load() { /*do something*/ } }
public class Employee implements Info extends Data { public void Data.load() { /*dsomething */ } public void load() { /*do something */ } }
public class Employee implements Info extends Data { public void load() { /*do something */ } public void Info.load(){ /*do something*/ } }
public class Employee extends Info implements Data{ public void Data.load() { /*do something*/ } public void Info.load() { /*do something*/ } }
第11题:
protected void change(int x){}
public void change(int x, int y){}
public void change(String s){}
public void change(int x){}
第12题:
abstract public void methoda ();
public abstract double inethoda ();
static void methoda (double dl) {}
public native double methoda () {}
protected void methoda (double dl) {}
第13题:
下列程序片段中,能通过编译的是( )。
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( ){};}
第14题:
下列程序片段中,能通过编译的是( )。
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{};}
第15题:
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?()
第16题:
Which lines of code are valid declarations of a native method when occurring within the declaration of the following class?() public class Qf575 { // insert declaration of a native method here }
第17题:
Which will declare a method that forces a subclass to implement it? ()
第18题:
作为类中新线程的开始点,线程的执行是从()方法开始的。
第19题:
Which method must be defined by a class implementing the java.lang.Runnable interface? ()
第20题:
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?()
第21题:
public class Employee implements Info extends Data { public void load(){/*dosomething*/} }
public class Employee extends Inf.implements Data{ public void load() {/*do something*/} }
public class Empl.yee implements Inf extends Data{ public void Data.1oad(){* do something*/} public void load(){/*do something*/} }
public class Employee extends Inf implements Data { public void Data.1oad() {/*do something*/) public void info.1oad(){/*do something*/} }
第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题:
protected void change (int x){}
public void change(int x, int y){}
public void change (int x){}
public void change (String s){}
第24题:
1
2
3
4