Composition: b's lifetime is up to its context (object of A).
==C++==
class A{
B b;
}
==java==
class A{
B b;
public A(){
b = new B();
}
}
Aggregation: b can live without its context (object of A).
============================================
==C++==
class B{
B* b;
}
==java==
class B{
B b;
public A(B b){
this.b = b;
}
}