On Jul 3, 9:40 am, JKid314159 <[email protected]> wrote:
> In the Student class I set up the constructor as follows:
>
> /**Creates a new instance of Student*/
>     public Student(){
>        this.studentRecord = new StudentRecord();
>     }//Student constructor
>
> This means when I instantiate a new Student object that it will
> inherit all the characteristics and behaviors (fields and methods) of
> the StudentRecord class?
Not inherit. Just initialise it's instance variable:studentRecord. To
inherit, you would need to apply another construct, namely <extends>.
For example:
class Student extends StudentRecord{}

Inheritance is covered in next few lessons. Use link in main page to
jump to it.
>
> My program is working but I just wanted to make sure what I was
> thinking is correct.
> Best,
> Alex

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