I am not very clear with your question. As far as I understood, I guess you are trying to create a linked list which should hold Parent and Child objects. You could do this without using Generics. List list = new LinkedList(); list.add(new Parent()); list.add(new Child()); Is this what you are looking for?
--- On Fri, 29/5/09, Lori Gardner <[email protected]> wrote: From: Lori Gardner <[email protected]> Subject: RE: [java programming] Re: help to me about Inheritance in java To: "[email protected]" <[email protected]>, "Free Java Programming Online Training Course By Sang Shin" <[email protected]>, "[email protected]" <[email protected]> Date: Friday, 29 May, 2009, 12:23 AM I have a similar situation, but it is a little different. I have a Parent class with an associated Child class. Using a linked list, how would I set this up so that when a new Parent was created, a Child multiple Child objects were also created. Thanks! From: [email protected] [[email protected]] On Behalf Of Lakshmi Chidambaram [[email protected]] Sent: Thursday, May 28, 2009 12:19 PM To: Free Java Programming Online Training Course By Sang Shin; [email protected] Subject: [java programming] Re: help to me about Inheritance in java Since the Person class is the super class of Manager and Employee, you can create it in the following way. Person[] person = {new Person(), new Employee(), new Manager() }; hope this is helpful. --- On Thu, 28/5/09, [email protected] <[email protected]> wrote: From: [email protected] <[email protected]> Subject: [java programming] help to me about Inheritance in java To: "Free Java Programming Online Training Course By Sang Shin" <[email protected]> Date: Thursday, 28 May, 2009, 10:21 PM I have three class as following - person class - employee class - manager class employee class and manager class extend the class person I want to create a person array with 3 elements element 1 is person element 2 is employee element 3 is manager how to create 3 elements ? Cricket on your mind? Visit the ultimate cricket website. Enter now! Cricket on your mind? Visit the ultimate cricket website. Enter http://beta.cricket.yahoo.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
