Search results

  1. F

    Adding elements to arrayList

    Thank you, that makes it clear what was happening.
  2. F

    Adding elements to arrayList

    Thank you for the response. I may have misinterpreted something you said; public class Nursery { private ArrayList<Newborn> nurseList; public Nursery() { nurseList = new ArrayList<Newborn>(); } public void add(Newborn n) { nurseList.add(n)...
  3. F

    Adding elements to arrayList

    Somehow, instead of using an <Newborn>ArrayList, I used a <String>ArrayList. my new code looks like this import java.util.ArrayList; public class Nursery { private static ArrayList<String> nurseList; public Nursery() { nurseList = new ArrayList<>(); } /**...
  4. F

    Adding elements to arrayList

    Homework Statement Now we are going to use the design pattern for collecting objects. We are going to model a hospital nursery filled with newborn babies. A Nursery uses an ArrayList to keep track of Newborn objects. You will write both a Nursery class and a Newborn class. A Newborn has a name...
Top