OCJP(310-065)

单选题Which Man clsss properly represents the relationship "Man has a best friend who is a Dog"?()A class Man extends Dog { }B class Man implements Dog { }C class Man { private BestFriend dog; }D class Man { private Dog bestFriend; }E class Man { private Dog

题目
单选题
Which Man clsss properly represents the relationship "Man has a best friend who is a Dog"?()
A

class Man extends Dog { }

B

class Man implements Dog { }

C

class Man { private BestFriend dog; }

D

class Man { private Dog bestFriend; }

E

class Man { private Dog; }

F

class Man { private BestFriend; }

如果没有搜索结果,请直接 联系老师 获取答案。
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

在下列程序的划线处应填入的语句是class Person { private int a;}public class Man extends Person{ public int b; public static void main (String arg []){ Person p=new Person(); Man t=new Man(); int i: }}

A.i=w;

B.i=b

C.i=p.a;

D.i=t.b;


正确答案:D
解析:选项A)w没有被声明过,不能使用。选项B)虽然b是类Man的public成员变量,但是在静态方法中不能使用类中的非静态成员。选项C)a是类Person的private成员,在类外不能直接引用。选项D)b是类Man的public成员变量,且是int 型,可以通过类的实例变量t用并赋值给一个int型变量。

第2题:

He is the man()dog bit me.

Athat

Bwhich

Cwhose


C

第3题:

He is the man () dog bit me.

A、that

B、which

C、who

D、whose


参考答案:D

第4题:

public class Pet{     private String name;     public Pet(){  System.out.print(1);    }  public Pet(String name){        System.out.print(2);    } }  public class Dog extends Pet{     public Dog(String name){        System.out.print(3);    } }  执行new Dog(“棕熊”);后程序输出是哪项?() 

  • A、 23
  • B、 13
  • C、 123
  • D、 321

正确答案:B

第5题:

He is the man()dog bit me.

  • A、that
  • B、which
  • C、whose

正确答案:C

第6题:

在下列程序的划线处应填入的语句是( )。 class Person { private int a: } public class Man extends Person{ public int b; public static void main(String arg []){ Person p=newPerson(); Man t=new Man(); int i; _________________ } }

A.i=w;

B.i=b;

C.i=P.a;

D.i=t.b;


正确答案:D

第7题:

He is the man()dog bit me.

Athat

Bwhich

Cwho’s

Dwhose


D

第8题:

He is the man( )dog bit me.

A. that

B. which

C. who's

D. whose


正确答案:D

第9题:

He is the man()dog bit me.

  • A、that
  • B、which
  • C、who’s
  • D、whose

正确答案:D

第10题:

10. interface Jumper { public void jump(); }  ......  20. class Animal {}  ......  30. class Dog extends Animal { 31. Tail tail; 32. }  ......  40. class Beagle extends Dog implements Jumper {  41. public void jump() { }  42. }  .......  50. class Cat implements Jumper {  51. public void jump() { }  52. }  Which three are true?()

  • A、 Cat is-a Animal
  • B、 Cat is-a Jumper
  • C、 Dog is-a Animal
  • D、 Dog is-a Jumper
  • E、 Cat has-a Animal
  • F、 Beagle has-a Tail
  • G、 Beagle has-a Jumper

正确答案:B,F

更多相关问题