abstract class and anonymous class
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/5154533/abstract-class-and-anonymous-class">abstract class and anonymous class</a>  </p>
</blockquote>



<pre><code>abstract class Two {
    Two() {
        System.out.println("Two()");
    }
    Two(String s) {
        System.out.println("Two(String");
    }
    abstract int  display();
}
class One {
    public Two two(String s) {
        return new Two() {          
            public int display() {
                System.out.println("display()");
                return 1;
            }
        };
    }
}
class Ajay {
    public static void main(String ...strings ){
        One one=new One();
        Two two=one.two("ajay");
        System.out.println(two.display());
    }
}
</code></pre>

<p>We cannot instantiate  an abstract class then why is the method <strong>Two two(String s)</strong> in class One returns an object of abstract class <strong>Two</strong></p>
