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

inner classes

 
george tharakan
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can a static innerclass can extend another class
class outer{
static class inner extend Frame{
inner()
{
super("my window");
setSize(300,300);
setVisible(true);
}
}
}
class test{
public static void main(String args[])
{
outer.inner i=new outer.inner();
}
}

kindly please explain the result.
------------------
 
Kalpesh Soni
Ranch Hand
Posts: 312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the program is running fine


------------------
KS
 
vadiraj vd
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi George,
static class is similar to any other non-static class except that
it has the access to only static members of the enclosing class.
So I think there's no harm by extending a class.

------------------
Regards
---------
vadiraj

*****************
There's a lot of I in J.
*****************
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic