wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes A query about this variable? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "A query about this variable?" Watch "A query about this variable?" New topic
Author

A query about this variable?

Marium Hasan
Greenhorn

Joined: Oct 03, 2001
Posts: 12

Hello,
Can anybody knows that this variable can access static
members. If so,can this variable access them before creating
object or after creating.
plz reply
Regards
Marium
Kris Nelson
Ranch Hand

Joined: Nov 04, 2001
Posts: 35
Marium,
Static members can be accessed by any instances of the class, so because "this" refers to the current instance, it CAN access the statis members of a class.
As for your second question, I'm not sure how you can use "this" in an object before it is created. You'll have to elaborate that question (probably with an example, code, etc.).

------------------
WebNelly.com
Java/XML Web Development
Check it out!
http://www.webnelly.com


WebNelly.com<br />Java/XML Web Development<br />Check it out!<br /><a href="http://www.webnelly.com" target="_blank" rel="nofollow">http://www.webnelly.com</a>
Marium Hasan
Greenhorn

Joined: Oct 03, 2001
Posts: 12

Thanks Kris
I got my answer. I just want to confirm whether
this variable can access static member before creating object
which is not possible.
Thanks again for the reply,
Marium
 
Don't get me started about those stupid light bulbs.
 
subject: A query about this variable?