The Java string is an array of zero or more Unicode characters which are stored in the heap memory, the string is an immutable, once, you assign a value to the string variable then you cannot change it, you can create a string object using below mentioned ways
Using String literal
Using new keyword
The example for string literal is assigning series of characters which are in the double quotes to the variable
You can create a string object using new keyword something like below, but this creates a new object in the heap memory instead of checking in the string constant pool
String’s are immutable once you create it in the memory you can not change it, instead of that it will create a new string
No related posts.
A technology enthusiast and a professional blogger from India. Through out my IT career, I have had the pleasure of working on various new technologies and built products like www.ziprides.com and some other products. Unfortunately, my attempts have not given me the desired results and as a result, I have finally decided to build a professional blog where I would like to share all my learnings and hoping to learn from other enthusiasts around the world.