Thread: OO and U
View Single Post
Old 05-10-2010, 08:57 PM   #12
Bill Bumface
My face is a bum!
 
Bill Bumface's Avatar
 
Join Date: Feb 2003
Exp:
Default

Quote:
Originally Posted by FanIn80 View Post
Sorry, one last question if you guys don't mind... How does a "constructor" fit into all of this? Is it just where you define how an object is instantiated?
Exactly. If you are making a new HockeyPlayer, HockeyPlayer may not be valid without a name and number, so you could have a constructor requiring those fields:

new HockeyPlayer Iggy = new HockeyPlayer("Jarome", 12);

I haven't coded in 7 years, so excuse any errors, but that's the idea.
Bill Bumface is offline   Reply With Quote
The Following User Says Thank You to Bill Bumface For This Useful Post: