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

Popular posts from this blog

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -