Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Gail Knight   on Jun 14 In Java Category.

  
Question Answered By: Chione Massri   on Jun 14

First step : string  s ="a"; line create  a new string object  and load JVM.
Object reference is s

Second step : s =s+"b"; line create a other new string Object and load JVM.
Object reference is s. But, first step object isn't a reference.
Garbage Collector remove it.

Share: 

 

This Question has 8 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on String Object Or get search suggestion and latest updates.


Tagged: