aspose file tools*
The moose likes Beginning Java and the fly likes query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "query" Watch "query" New topic
Author

query

Ajay Kumar Rana
Greenhorn

Joined: Feb 27, 2008
Posts: 13
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

Joined: Nov 18, 2006
Posts: 689

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

Joined: Oct 30, 2001
Posts: 1970
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 ]

Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: query