• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Self?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
reply
    Bookmark Topic Watch Topic
  • New Topic