Tuesday, April 5, 2011

Constructor Confusion

Problem: When I went to run my program, I got an error that 'There is no empty constructor for this class'.

Impact: The program would not load.

Solution: Normally, you can have 2 types of constructors be mutually exculsive from eachother - one with parameters, one without. In this case, I created a constructor that took 2 parameters. The problem was that this class needed to have a constructor that took no parameters as well.

No comments:

Post a Comment