What can be collected

Report a typo

Consider code that does the following:

  1. Creates a string array bookNames and an integer array bookPages, both of length 1000.
  2. Creates 1000 objects of the class Book with a string member bookInfo composed using bookNames and bookPages values of the same index.
  3. Prints bookInfo of all created book objects.

What can be cleaned up during the garbage collection process after each of the steps above? Assume that the program starts right before step 1 and terminates right after step 3 without performing any additional operations.

Match the items from left and right columns
After step 1
After step 2
After step 3
bookNames and bookPages arrays
None of the mentioned objects
Objects of the Book class
___

Create a free account to access the full topic