File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Constructor

 
shiva shankar
Ranch Hand
Posts: 85
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
When I am calling a constructor within a constructor, why is it that I need to call using this(). Why can't I use the same name as that of class when I am overloading the constructor.
Regds
Shiva
 
Donald R. Cossitt
buckaroo
Ranch Hand
Posts: 401
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess is that to use MyClass( name ) is trying to say we want a 'new' object not use a constructor. While the keyword this() is saying a constructor of 'this' class.

Is this clear as mud?
 
John Lee
Ranch Hand
Posts: 2545
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic