• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Self?

 
Josh Huynh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to figure out the answer this question. I tried googling and looking through my PDF text book none of which is able to tell me the value when "self" is used. I understand the basics, ex is a object of method example and 7 is placed in x making val=7.

 
Winston Gutkowski
Bartender
Pie
Posts: 10103
56
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Josh Huynh wrote:I'm trying to figure out the answer this question. I tried googling and looking through my PDF text book none of which is able to tell me the value when "self" is used. I understand the basics, ex is a object of method example and 7 is placed in x making val=7.

This sounds like PHP to me - regular Java does not have a "self" keyword. So I'm moving this post to that forum.

If I'm wrong, let me know, and I'll move it to somewhere more appropriate.

Winston

[Edit] Oops, might have jumped the gun.
@Josh: Let me know if this was intended to be a Java question or whether you are, in fact, writing PHP code. If the first, I'll move it back.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch. Given that the code doesn't compile, the question is moot My guess is that the author of this code meant to use this, not self (which doesn't exist in Java): http://en.wikipedia.org/wiki/This_%28computer_programming%29#Java
 
Josh Huynh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Updating this. You guys were right. I basically wrote in the question that there is no self in java and explained the differences between self and this. Teacher gave me full credit for doing the research. Thanks for your help!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic