Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HeadFirst Java Page 268 5 minute mystery Urgent Help  RSS feed

 
Elim Banda
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please explain what the line of code does what does I can make out that its add a SimUnit object to the arraylist but what does ("Retention") do please be as detailed as possible.

 
Stephan van Hulst
Saloon Keeper
Posts: 7800
142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's just a string value that's being passed to the SimUnit constructor. Have you been through the Java tutorials?
 
Ganesh Patekar
Bartender
Posts: 696
23
Eclipse IDE Hibernate Java jQuery MySQL Database Netbeans IDE Oracle Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And that newly created object of SimUnit class having instance variable String botType assigned by value "Retention" is added to ArrayList referred by rlist.
 
drac yang
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and rlist should be referenced elsewhere besides RetentionBot constructor so that it can be used for any more meaningful purpose after it's been stuffed an element of SimUnit instance.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!