Composition and Aggregation code
<p>In composition the contained object is destroyed once the container object destroys where-as in aggregation it is not so.</p>

<p>can this be thought of as a Composition code ??</p>

<pre><code>class A
{
    Integer a = new Integer();
}
</code></pre>

<p><strong>Aggregation</strong></p>

<pre><code>class Room
{
    House house;
    public void main(String args[])
    {  
        house = new House();
    }
}

class House
{

}
</code></pre>
