易搜题 > 资格证大类 > 计算机编程 > 问题详情
问题详情

Which two are true about has-a and is-a relationships?()

A

 Inheritance represents an is-a relationship.

B

 Inheritance represents a has-a relationship.

C

 Interfaces must be used when creating a has-a relationship.

D

 Instance variables can be used when creating a has-a relationship.

未找到的试题在搜索页框底部可快速提交,在会员中心"提交的题"查看可解决状态。 收藏该题
查看答案

相关问题推荐

  • Which method will complete this class?()

    A、 public int compareTo(Object o){/* more code here */}

    B、 public int compareTo(Score other){/* more code here */}

    C、 public int compare(Score s1, Score s2){/* more code here */}

    D、 public int compare(Object o1, Object o2){/* more code here */}

  • public class Foo implements Runnable (  public void run (Thread t) {  system.out.printIn(“Running.”);  }  public static void main (String[] args)  {  new thread (new Foo()).start();  } )   What is the result?()      

    A、 An exception is thrown.

    B、 The program exists without printing anything.

    C、 An error at line 1 causes compilation to fail.

    D、 An error at line 2 causes the compilation to fail.

    E、 “Running” is printed and the program exits.

  • int x=0;  int y 10;  do {  y--;  ++x;  } while (x 

    A、 5,6

    B、 5,5

    C、 6,5

    D、 6,6

  • class A {  public A() {  System.out.println(“hello from a”);  }  }  class B extends A {  public B () {  System.out.println(“hello from b”);  super();  }  }  public class Test {  public static void main(String args[]) {  A a = new B();  }  }   What is the result when main is executed?()  

    A、 Compilation fails.

    B、 hello from a

    C、 hello from b

    D、 hello from b hello from a

    E、 hello from a hello from b

  • Which capability exists only in java.io.BufferedWriter?()

    A、Closing an open stream.

    B、Flushing an open stream.

    C、Writing to an open stream.

    D、Writing a line separator to an open stream.

联系客服 会员中心
TOP