The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
September 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Instantiating interfaces

Posted by Abha Thakur on September 18, 2000 at 2:25 PM

> Could someone please explain to me why the code
> Runnable run = new Runnable() works? I used to believe that interfaces where implicitly abstract and therefore could not be instantiated; only implemented. Is Object somehow involved in this???

> Thanks,
> Shaul

------------
Not only JDK1.3 but even JDK1.1.8 and 1.2.2 will give you a compile time error should you try to do that, coz I tried to test it to find if it was indeed a bug in the old compilers but they complained, so I'm wondering which compiler version are u using?!






Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us