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 use of this() function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "use of this() function" Watch "use of this() function" New topic

use of this() function

Rajesh Veluchamy
Ranch Hand

Joined: Jan 15, 2008
Posts: 47
1.what is the use of "this();" in EmailAct constructor

2.should "this();" function call be first line only?

-Rajesh.V<br /> Software Consultant
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15081

It calls the constructor of the class EmailAct that takes no arguments. Note that the code above will not compile, because class EmailAct doesn't have a constructor without arguments. I suspect that you copied and pasted part of the code and left something out.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Rajesh Veluchamy
Ranch Hand

Joined: Jan 15, 2008
Posts: 47

Thanks for your Kind your reply
I agree. Here's the link:
subject: use of this() function
It's not a secret anymore!