File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[to - Eric]..inner class

 
chao-long liao
Ranch Hand
Posts: 78
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inner classes are real classes, and can be manipulated the same as "top-level" classes,an inner class can implement an interface or extend a class.
//try this code
interface S{}
class Base {}
public class A{
public static void main(String argv[]){}
private class inner extends Base implements S{}
}
 
Ashik Uzzaman
Ranch Hand
Posts: 2373
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Nice liao! The code shows that inner classes can also extend
interfaces like package-level classes...

------------------
azaman
 
Eric Pramono
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Liao..
Really appreciate it..
Regarding my other thread... http://www.javaranch.com/ubb/Forum24/HTML/011363.html
I think that anonymous class is the one that cannot extends an explicit class and implements an interface at the same time..
am I right?
- eric
 
Ashik Uzzaman
Ranch Hand
Posts: 2373
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
U should be right eric!
------------------
azaman
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic