This week's book giveaway is in the Java in General forum. We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line! See this thread for details.
Elim Banda wrote:So it passes in everything in the Arraylist? what does it then do with the arraylist?
You better post complete code, so more people may try to answer you
Elim Banda wrote:V2Radiator v2 = new V2Radiator(aList); //What does this statement do?
You are creating an object of V2Radiator and passing a reference of object of ArrayList assigned to aList reference variable to the parameterized constructor of V2Radiator class.
Hope this is the program you are talking about. Source: Head First Java Ch.9 Page No 268
Look at line no 6, aList reference variable is passed to the parameterized constructor of V2Radiator where It adds 5 new objects of SimUnit to the ArrayList object referred by aList, each object of SimUnit class having instance variable String botType assigned by value "V2Radiator" which is also passed as argument to the parameterized constructor of SimUnit class.