Forums Register Login

Static classes and Static interfaces

+Pie Number of slices to send: Send
Hi ,
Maybe this sounds a bit stupid, but what exactly are static classes and static interfaces? What is their use? I could not get hold of any satisfactory material.Can any one Help??
Thanks
Pallavi.
+Pie Number of slices to send: Send
static classes/interfaces MUST declared as inner classes/interfaces.
You might benefit from investigating the use of inner classes/interfaces.
You'll receive varying opinions regarding their use, since there is an on-going subjective debate about when, and how they are used, if ever.
+Pie Number of slices to send: Send
Thanks Tony!!!
+Pie Number of slices to send: Send
Hi ,
I just saw ur query ( a bit of confusing though static classes are but u see not everything is fare when it comes to code ).
First thing is that inner classes are complied in a seperate .class file .
So if you want do some operations just at development time ( like testing and debugging) you can include its code in an inner class. While you may not deploy this .class file at runtime ( a big benefit when it comes to testing and t hen deploying web applications).
While the inner class can access members of outer class it is tightly coupled wtih outer class which is against Encapsulation.
Also sometimes they make the code really puzzling
You got style baby! More than this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 574 times.
Similar Threads
Help on explanation on Top level class
Can interface include Anonymous class?
Nested Interfaces
Diff. b/w Names Inner,Anonymous,Local..
i need some explanation..
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 05:26:11.