Hi Louis,
The following is the details of Homework.
# Create a Student class as following:
* The Student class has StudentRecord class as an instance
variable. Name it as studentRecord.
* You can use the StudentRecord class from the
MyStudentRecordExampleProject above or you can create a new one -
the only requirement is that it has to have at least one
instance variable of its own.
* The Student class has studentId instance variable whose
type is Integer type.
* Move the studentCount static variable from the
StudentRecord class to Student class.
# Rewrite main.java as following
* Create 3 instances of Student class and initialize them
accordingly - use whatever initialization values that are
appropriate.
* Display the information of each student including the student id, name.
* Display the studentCount.
There is no requirement of InnerClass implementation here.
Thanks,
Ashok A V
On Sun, Aug 9, 2009 at 8:13 PM, Louis (comcast)<[email protected]> wrote:
> You appear to be giving 2 different answers.
> Which way is this to be done:
> 1) instance of another class
> 2) nested classes
>
> Sorry, but I am still confused on this.
>
>
> ----- Original Message ----- From: "Ashok A V" <[email protected]>
> To: <[email protected]>
> Cc: <[email protected]>
> Sent: Saturday, August 08, 2009 3:22 PM
> Subject: [java programming] Re: LAB-1014
>
>
>
> Hi ,
>
> It is an instance of another class being created rather than a class
> within a class . Its object association that we have here .
>
> The Java programming language allows you to define a class within
> another class. Such a class is called a nested class and is
> illustrated here:
>
> class OuterClass {
> ...
> class NestedClass {
> ...
> }
> }
>
> http://java.sun.com/docs/books/tutorial/java/javaOO/nested.html
>
> Thanks,
> Ashok A V
>
> On Sun, Aug 9, 2009 at 12:16 AM, Michael Dabydeen<[email protected]>
> wrote:
>>
>> Its sort of a nested class
>>
>>
>> public class Student{
>>
>> /* This is the StudentRecord Class created outside of this class*/
>>
>> StudentRecord newStudent = new StudentRecord();
>>
>> ..........
>>
>> }
>>
>> On 8/8/09, Louis (comcast) <[email protected]> wrote:
>>>
>>> LAB-1014 Question: the homework states:
>>> "The Student class has StudentRecord class as an instance variable. Name
>>> it
>>> as studentRecord"
>>> Can you please explain this? Do you want a "nested class"?
>>>
>>> Thanks,
>>>
>>> >
>>>
>>
>> >
>>
>
>
>
> --
> Victory belongs to the most persevering.
> - Napoleon
>
> >
>
>
>
--
Victory belongs to the most persevering.
- Napoleon
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---