String object in java -
as know string immutable, means new instance created every time.
my question if write:
system.out.println("java"+"is"+"programming"); then how many objects created in pool?
your example create single string object in string pool.
after that, if do:
string x = "javaisprogramming"; it still point same object in string pool. can read more here
Comments
Post a Comment