Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with constructors  RSS feed

 
Troy Johnson
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. I am trying to add two additional constructors, one that takes "the annual interest rate" and "loan amount", and another that takes just the "loan amount" only. I am just a little confused on this and looking for any suggestions. Thanks.

[ October 19, 2003: Message edited by: Troy Johnson ]
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Troy,
Why confused? You've already got a default constructor that calls the 3-argument one with three default arguments. Now make two more constructors that take one and two arguments each, and have them pass their arguments, along with 2 and 1 default parameters, respectively, in the right order, of course, to the three argument one; then Bob's your uncle!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!