This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes can i use Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "can i use "this" name for any method as an identifier in java." Watch "can i use "this" name for any method as an identifier in java." New topic
Author

can i use "this" name for any method as an identifier in java.

Omkar G. Deshmukh
Ranch Hand

Joined: Sep 21, 2012
Posts: 40
can i use "this" name for any method as an identifier in java.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

Only in non-static methods to refer to the object instance. There is no object instance in the case of static methods, so no this.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can i use "this" name for any method as an identifier in java.
 
Similar Threads
Interesting Question!!!
method invocation
Reflection doubt
Why we pass string object to main?
Illegal Identifiers