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
Forums
Register
Login
Certification
»
Programmer Certification (OCPJP)
static
arivu mathi
,
Ranch Hand
Aug 01, 2006 23:40:00
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
can we use this reference inside a static method or a class?
can we use static and native together?
can anyone explain this?
Arafat Nalkhande
,
Ranch Hand
Aug 01, 2006 23:54:00
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
We cannot use 'this' refernce inside the static methods.
Reason for it is that 'this' belongs to an instance whereas static stuff does not belong to any particular instance, but to the class in general.
Gowher Naik
,
Ranch Hand
Aug 01, 2006 23:57:00
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
this is non static and cannot be refered from static context.
A method can be both native and staic.
Post by:
autobot
brevity is the soul of wit - shakepeare. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
This thread has been viewed 540 times.
Similar Threads
how counter variable works in jsp
Why calling super to reach a static member is ALWAYS illegal?
static block
Static
Cookies
More...
All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 01:36:13
.