java - How many objects are there? -


this question has answer here:

string s1=new string("rahul"); s1=new string("rahul"); s1=new string("kumar"); string s2=new string("rahul"); s2=new string("rahul"); s2=new string("kumar");  

// how many objects created?

every new string(...) creates new object. in example 6 objects created.


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

post - imageshack API cURL -