网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
现有: class ThreadBoth extends Threaa implements Runnable { public void run() (System.out.print("hi"); } public static voicl main (String [] args) { Thread tl=new ThreadBoth(): Thread t2 = new Thread (tl): tl.run(): t2.run(): } 结果为:()
A
hi hi
B
hi
C
编译失败
D
运行时异常被抛出
参考答案
参考解析
解析:
暂无解析
更多 “单选题现有: class ThreadBoth extends Threaa implements Runnable { public void run() (System.out.print("hi"); } public static voicl main (String [] args) { Thread tl=new ThreadBoth(): Thread t2 = new Thread (tl): tl.run(): t2.run(): } 结果为:()A hi hiB hiC 编译失败D 运行时异常被抛出” 相关考题
考题
下列哪个类声明是正确的?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{……}
考题
下列类头定义中,错误的是( )。
A.class x { .... }B.public x extends y { .... }C.public class x extends y { .... }D.class x extends y implements y1 { .... }
考题
现有两个类A,B,以下描述中表示B继承自A的是 ( )A.class A extends BB.class B implements AC.class A implements BD.class B extends A
考题
在下面程序的下画线处应填入的选项是 public class Test______{ public static void main(String args[]) { Test t=new Test(); Thread tt=new Thread(t); tt.start(); } public void run() { for(int i=0;i<5;i++) System.out.println("i="+i); } }A.implements RunnableB.extends ThreadC.implements ThreadD.extends Runnable
考题
在程序的下画线处应填入的选项是( )。 A.implements RunnableB.extends Thread
在程序的下画线处应填入的选项是( )。A.implements RunnableB.extends ThreadC.implements ThreadD.extends Runnable
考题
下列关于Test类的定义中,正确的是( )。A.class Test implements Runnable{ public void run{} Dublic void someMethod[]{} }B.class Test implements Runnable( puIblic void run; }C.class Test implements Runnable( Dublic void someMethod[]; }D.class Test implements Runnable( public void someMethod{} }
考题
在程序的下面线处应填人的选项是( )。 A.implements RunnableB.extends Thread
在程序的下面线处应填人的选项是( )。A.implements RunnableB.extends ThreadC.implements ThreadD.extends Runnable
考题
( 30 )在程序的下划线处应填入的选项是public class Test _________{public static void main(String args[]){Test t = new Test();Thread tt = new Thread(t);tt.start();}public void run(){for(int i=0;i5;i++){system.out.println( " i= " +i);}}}A ) implements RunnableB ) extends ThreadC ) implements ThreadD ) extends Runnable
考题
interface Data { public void load(); } abstract class Info { public abstract void load(); } Which class correctly uses the Data interface and Info class?() A、 public class Employee extends Info implements Data { public void load() { /*do something*/ } }B、 public class Employee implements Info extends Data { public void load() { /*do something*/ } }C、 public class Employee extends Info implements Data { public void load() { /*do something */ } public void Info.load() { /*do something*/ } }D、 public class Employee implements Info extends Data { public void Data.load() { /*dsomething */ } public void load() { /*do something */ } }E、 public class Employee implements Info extends Data { public void load() { /*do something */ } public void Info.load(){ /*do something*/ } }F、 public class Employee extends Info implements Data{ public void Data.load() { /*do something*/ } public void Info.load() { /*do something*/ } }
考题
现在有两个类A、B,以下描述中表示B继承自A的是()A、class A extends BB、class B implements AC、class A implementsD、class B extends A
考题
现自: 1. interface Color { } 2. interface Weight { } 3. //insert code here 和以下足六个声明: class Boat extends Color, extends Weight { } class Boat extends Color and Weight { } class Boat extends Color, Weight { } class Boat implements Color, implements Weight { } class Boat implements Color and Weight { } class Boat implements Color, Weight { } 分别插入到第3行,有多少行可以编译? () A、 0B、 1C、 2D、 3
考题
下列类的定义中,错误的是()。A、class x{....}B、public x extends y{....}C、public class x extends y{....}D、class x extends y implements y1{....}
考题
下列代码正确的是哪项?() A、 public class Session implements Runnable, Clonable{ public void run ();public Object clone () ; }B、 public class Session extends Runnable, Cloneable { public void run() {/*dosomething*/} public Object clone() {/*make a copy*/} }C、 public abstract class Session implements Runnable, Clonable { public void run() {/*do something*/} public Object clone() {/*make a copy*/} }D、 public class Session implements Runnable, implements Clonable { public void run() {/*do something*/} public Object clone() {/*make a copy*/} }
考题
Which two demonstrate an “is a” relationship?() A、 public interface Person { } public class Employee extends Person { }B、 public interface Shape { } public class Employee extends Shape { }C、 public interface Color { } public class Employee extends Color { }D、 public class Species { } public class Animal (private Species species;)E、 interface Component { } Class Container implements Component ( Private Component[ ]children; )
考题
现有: class ThreadBoth extends Threaa implements Runnable { public void run() (System.out.print("hi"); } public static voicl main (String [] args) { Thread tl=new ThreadBoth(): Thread t2 = new Thread (tl): tl.run(): t2.run(): } 结果为:() A、 hi hiB、 hiC、编译失败D、运行时异常被抛出
考题
单选题下列代码正确的是哪项?()A
public class Session implements Runnable, Clonable{ public void run ();public Object clone () ; }B
public class Session extends Runnable, Cloneable { public void run() {/*dosomething*/} public Object clone() {/*make a copy*/} }C
public abstract class Session implements Runnable, Clonable { public void run() {/*do something*/} public Object clone() {/*make a copy*/} }D
public class Session implements Runnable, implements Clonable { public void run() {/*do something*/} public Object clone() {/*make a copy*/} }
考题
单选题现有: interface Data {public void load();} abstract class Info {public abstract void load();} 下列类定义中正确使用Data和Info的是哪项?()A
public class Employee implements Info extends Data { public void load(){/*dosomething*/} }B
public class Employee extends Inf.implements Data{ public void load() {/*do something*/} }C
public class Empl.yee implements Inf extends Data{ public void Data.1oad(){* do something*/} public void load(){/*do something*/} }D
public class Employee extends Inf implements Data { public void Data.1oad() {/*do something*/) public void info.1oad(){/*do something*/} }
考题
单选题interface Data { public void load(); } abstract class Info { public abstract void load(); } Which class correctly uses the Data interface and Info class?()A
public class Employee extends Info implements Data { public void load() { /*do something*/ } }B
public class Employee implements Info extends Data { public void load() { /*do something*/ } }C
public class Employee extends Info implements Data { public void load() { /*do something */ } public void Info.load() { /*do something*/ } }D
public class Employee implements Info extends Data { public void Data.load() { /*dsomething */ } public void load() { /*do something */ } }E
public class Employee implements Info extends Data { public void load() { /*do something */ } public void Info.load(){ /*do something*/ } }F
public class Employee extends Info implements Data{ public void Data.load() { /*do something*/ } public void Info.load() { /*do something*/ } }
考题
多选题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?()Apublic class Circle implements Shape { private int radius; }Bpublic abstract class Circle extends Shape { private int radius; }Cpublic class Circle extends Shape { private int radius; public void draw(); }Dpublic abstract class Circle implements Shape { private int radius; public void draw(); }Epublic class Circle extends Shape { private int radius;public void draw() {/* code here */} }Fpublic abstract class Circle implements Shape { private int radius;public void draw() { / code here */ } }
考题
单选题class ThreadBoth extends Thread implements Runnable { public void run(){ System.out.print("hi "); } public static void main(String [] args){ Thread t1 = new ThreadBoth(); Thread t2 = new Thread(t1); t1.run(); t2.run(); } } 结果为:()A
hiB
hi hiC
编译失败D
代码运行,但无输出结果
考题
单选题下列类的定义中,错误的是()。A
class x{....}B
public x extends y{....}C
public class x extends y{....}D
class x extends y implements y1{....}
考题
多选题Which two demonstrate an “is a” relationship?()Apublic interface Person { } public class Employee extends Person { }Bpublic interface Shape { } public class Employee extends Shape { }Cpublic interface Color { } public class Employee extends Color { }Dpublic class Species { } public class Animal (private Species species;)Einterface Component { } Class Container implements Component ( Private Component[ ]children; )
考题
单选题现有: 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
考题
多选题Which the two demonstrate an “is a” relationship?()Apublic interface Person {} Public class Employee extends Person {}Bpublic interface Shape {} public interface Rectangle extends Shape {}Cpublic interface Color {} public class Shape { private Color color; }Dpublic class Species {} public class Animal { private Species species; }Einterface Component {} Class Container implements Component {private Component [] children;
考题
单选题现自: 1. interface Color { } 2. interface Weight { } 3. //insert code here 和以下足六个声明: class Boat extends Color, extends Weight { } class Boat extends Color and Weight { } class Boat extends Color, Weight { } class Boat implements Color, implements Weight { } class Boat implements Color and Weight { } class Boat implements Color, Weight { } 分别插入到第3行,有多少行可以编译? ()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
热门标签
最新试卷