Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A query about this variable?

 
Marium Hasan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Marium Hasan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic