Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
inner
Anonymous
Ranch Hand
Posts: 18944
posted 22 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi!
I read that non static inner class may have a statics member
What static members??
Thank you in advance.
swati bannore
Ranch Hand
Posts: 201
posted 22 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
It Can have static final variables..
Correct me if i am wrong
Thanx
Swati Kale
SCJP
SCWCD
Anonymous
Ranch Hand
Posts: 18944
posted 22 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Non-Static Inner Classes cannot have Static members. I agree with Swati.
Toying around with this code might help.
public class Client extends Object{ public static void main(String args[]){ System.out.println(Client.Inner.j); } class Inner{ static int j = 10; //will not compile. Have to add "final" to static } } </font>
Shyam
[This message has been edited by Shyamsundar Gururaj (edited September 12, 2001).]
Bindesh Vijayan
Ranch Hand
Posts: 104
posted 22 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I want to add to this disucssion that non-static inner class can inherit static members if needed.
Thanks
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Question about static class
doubt on Inner class
is inner class can be static . what is the purpose of inner class ??
Top-level classes
Member class can have static variables??
More...