File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes What is this() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What is this() method" Watch "What is this() method" New topic

What is this() method

jo sim
Ranch Hand

Joined: Apr 24, 2006
Posts: 37
Hi I want to know what is this() can someone just give me a small example of how it works or a site where i can read more about it. Please

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

It is an explicit call to the no arguments constructor of an object. For example:

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
marc weber

Joined: Aug 31, 2004
Posts: 11343

See Calling constructors from constructors from Eckel's Thinking in Java.

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sven studde
Ranch Hand

Joined: Sep 26, 2006
Posts: 148
I agree. Here's the link:
subject: What is this() method
jQuery in Action, 3rd edition