Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

query

 
Ajay Kumar Rana
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All methods in a class are implicitly passed a this parameter when called.

Is this true or false ? why or why not.
 
Kaydell Leavitt
Ranch Hand
Posts: 690
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is true except for methods that are declared with the keyword "static" as a qualifier.

This is because sometimes, there is no object to pass. For example, you can take the square-root of a primitive with a static method because there is no objet -- only a primitive.

For example;

int a = Math.sqrt(9);

Above, instead of using an object (because there is no object) the class name, "Math" is used to call the static method Math.sqrt(int);
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ajay Kumar Rana:
All methods in a class are implicitly passed a this parameter when called.

Is this true or false ? why or why not.


This, like your several other recent posts, has the look of a homework question. Poster, please DoYourOwnHomework or at least ShowSomeEffort before posting your homework. Responders, please LetThemDoTheirOwnHomework.
[ February 28, 2008: Message edited by: Peter Chase ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic