Question: How many of the String objects are eligible for garbage collection right before the end of the main() method? A. None B. One C. Two
How many of the String objects are eligible for garbage collection right before the end of the main() method?
![public static void main(String[] ohMy) { String animal1 = new String("lion"); String](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1707/2/0/7/79365c1ec713af1c1707207794188.jpg)
A. None
B. One
C. Two
D. Three
E. None of the above
public static void main(String[] ohMy) { String animal1 = new String("lion"); String animal2= new String("tiger"); String animal3 = new String("bear"); } animal3 animall; animal2 animal3; animall animal2;
Step by Step Solution
There are 3 Steps involved in it
To determine the number of String objects that are eligible for garbage collection by the end of the ... View full answer
Get step-by-step solutions from verified subject matter experts
