So, you mean that this constructor should take only name and averageGrade as parameters? It's kind of obscure - averageGrade is declared as private, so how do we just set it regardless of access rights? Or we need to have setAverage() method? Please, clarify this moment.
On Mar 11, 6:32 pm, miga <[email protected]> wrote: > On Mar 11, 3:07 pm, Jerrold <[email protected]> wrote:> Hi miga, > > > i am confused because as what i have come to understand with the > > problem. the average grade is to be computed after setting the grades > > for math.. etc. > > So does this mean that what i am to make a parameter of my constructor > > computes for the average grade already? like the constructor would > > take in as parameter the grades and also the average grade? > > Or am i not getting it right? > > It is a way of verifying that if at any chance somebody passes an > average it is the right one, for example you could compare the average > passed to the one calculated. And no, it is not stupid, it is on the > contrary very useful, in case some man in the middle injects some > average which is not fully right. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -~----------~----~----~----~------~----~------~--~---
