View Single Post
  #2 (permalink)  
Old 08-06-2007, 10:12 PM
hardwired hardwired is offline
Senior Member
 
Join Date: Jul 2007
Posts: 1,222
hardwired is on a distinguished road
Your only constructor
Code:
public GuiGuessingGameFrame(int mySecretNumber)
takes an int argument. In your test class you are using
Code:
new GuiGuessingGameApp();
a no–argument constructor which the class does not have.
If you do not explicitly define a constructor for a class java provides a no–argument constructor for it. If you provide any constructor that takes arguments you no longer get the default no–arg constructor from java. In this case you must add a no–argument constructor in the class.
Reply With Quote