Forums Register Login

about Object declaration as static

+Pie Number of slices to send: Send
Can we declare an object of class as Static.If it can be declared static what is it's use
+Pie Number of slices to send: Send
You will see that you cannot declare a static class.
+Pie Number of slices to send: Send


The method readMe() belongs to the class, and not any particular instance of the class.

Realize, you can have nested member classes (classes declared in body of top-level class), which may be static. But this follows the same idea that, when dealing with classes, only members of the class can be declared static.

You can get a better grip on this idea by reading a definition of the static modifier here.
[ June 07, 2004: Message edited by: Jeffrey Hunter ]
She's brilliant. She can see what can be and is not limited to what is. And she knows 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 622 times.
Similar Threads
Single tone Vs Static
Head First Java Chapter 15 problem
Doubt in Setting the session scope as Application
this!!
What is "non-static method" vs "static context" ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:27:54.