When to use abstract classes and when to use interfaces
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1231985/when-to-use-interfaces-or-abstract-classes-when-to-use-both">When to use interfaces or abstract classes? When to use both?</a>  </p>
</blockquote>



<p>Consider this </p>

<pre><code>public abstract class Flat
{
    //some properties


    public void livingRoom(){
       //some code
    }

    public void kitchen(){
       //some code
    }

    public abstract void bedRoom();

}
An implementation class would be as follows:

public class Flat101 extends Flat
{
        public void bedRoom() {
            System.out.println("This flat has a customized bedroom");
       }        

}
</code></pre>

<p>Alternatively I can use an interface instead of an abstract class to achieve the same purpose like follows:</p>

<pre><code>class Flat
{
  public void livingRoom(){ 
       System.out.println("This flat has a living room");
  }

  public void kitchen(){
     System.out.println("This flat has a kitchen");
 } 
</code></pre>

<p>}</p>

<pre><code>interface BedRoomInterface
{
     public abstract void bedRoom();
}

public class Flat101 extends Flat implements BedRoomInterface
{
       public void bedRoom() {
      System.out.println("This flat has a customized bedroom");
       }
}
</code></pre>

<p>Now the question is : For this setup why should choose to use an interface (or) why should I choose to use an abstract class?</p>
