This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

static

 
arivu mathi
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 643
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is non static and cannot be refered from static context.
A method can be both native and staic.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic