hello.i am not really having a problem, just a problem understanding wha my teacher wants. she assigned us a basic project, nothing special, for beginners. i got everything down, and this is where i get confused.
in the coinChanger class, comment out the constructor that was provided. when a class does not have a constructor the compiler will provide a default constructor which will store zero values in the numeric data fields and blanks in char and string fields. wriote a four setter methods(mutators) to set the value of each one member variables.
ok so i have no clue what she means when she says comment the constructor? i dont see one, and she said comment it. so im not sure. also the mutators have to be in the same class? i provided the class's below, there are 2 classes so dont get confused liek me.
I don't see a default constructor in the class CoinChanger
This line CoinChanger coins = new CoinChanger();
is using a default constructor to create an instance of CoinChanger and is doing exactly what she has asked.
I think its that she wanted to you to set all of the instacne variables be initialised in the default constructor and when you will comment it out they will be initialised by JVM to standard values for any of th elegacy data ypes....