I encounter problem regarding above. More details below:

About:
5. (For your own exercise) Modify StudentRecord.java and
ConstructorExample.java as following. Build and run the project.
Create another Constructor in the StudentRecord.java in which average
is also passed as a parameter.
Modify the ConstructorExample.java so that StudentRecord annaRecord
object is created with the newly added Constructor.

In StudentRecord.java: I overloaded a constructor like this:
    public StudentRecord(String name,double mathGrade,double
engGrade,double sciGrade,double avg){
        this(name,mathGrade,engGrade,sciGrade);
        average=avg;
    }

In ConstructorExample.java: I tried to create annaRecord object like
this:
// Wrong. How?
StudentRecord annaRecord=new StudentRecord("Anna",
90,91,92,annaRecord.getAverage());

Thank you.



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to