• Post Reply Bookmark Topic Watch Topic
  • New Topic

Class Loading for Inner Classes  RSS feed

 
KasiMurugan Ramasamy
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,

I have a class inside a method(local class). This method is reffered frequently.

Whether the class will be loaded every time i make a call to this method or not?.

And i would like to know about that whether its affects the performance?

Thanks & Regards
Kasimurugan R.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The class will be loaded just once, the first time the method is called.
 
KasiMurugan Ramasamy
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

Iam asking about local class not top level class. If you have any guide about class loading for local class, provide me the same.
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the inner class is not static then its loaded with the outer class. If the inner class is static then it will probably behave just like an outer class.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!