Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Multiple Constructors

 
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I have a constructor that calls another constructor...
Program 1:
User currentUser = new User();
Program 2 (User):

------------------
I'm a soldier in the NetScape Wars...
Joel
[This message has been edited by Joel Cochran (edited December 05, 2001).]
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Absolutely, however there is one rule. The call must be made on the first line of the constructor. No where else. Also the syntax is a bit different than you used.

Of course if you call another constructor on the first line that prevents you from calling a specific super() constructor on that line - so make your design carefully.
 
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How come the code comes out differently in IE and Netscape. The first posting's code comes out too small in IE. The second comes posting's code comes out bigger in IE, but the same size as the first posting for IE. :-)
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The first post was using the [ code][ /code] (without the spaces) tags and picks up the default font size.
The second post was using:
[ CODE]< font size=2.5>
< /font>[ /code]
(without the spaces)
and forces a font size.
You can also use< font size=+1>
etc.
 
Hoo hoo hoo! Looks like we got a live one! Here, wave this tiny ad at it:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic