类的关系为:

is-a:

has-a:

use-a:

is-a 为继承,或实现,

has-a 为组合或聚集

use-a为使用。

类解释:

has a ,is a use a

public class A {
          B  b = new B();
          void dummyMethod() {
             .....
          }
        }



public class A{
             void dummyMethod() {
                B b = new B();
                b.doSomething();
                ....
              }
       }

 

相关文章:

  • 2021-06-22
  • 2021-09-10
  • 2021-09-14
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
猜你喜欢
  • 2022-12-23
  • 2021-10-28
  • 2021-04-18
  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
相关资源
相似解决方案