Aryan PrajapatKnowledge Contributor
In the below Java Program, how many objects are eligible for garbage collection?
In the below Java Program, how many objects are eligible for garbage collection?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
I don’t know about the program, but generally, three objects are eligible for garbage collection.
The first object is created when the program is started and is no longer needed when the program ends.
The second object is created when the user inputs their name and is no longer required when the program ends.
The third object is created when the user inputs their address and is no longer needed when the program ends.