Can I read Understanding Java String Objects on EtoBox?
Understanding Java String Objects by NaveenKumar is a document available to read on EtoBox.
What is Understanding Java String Objects about?
String objects in Java can be created in two ways: using the new operator or string assignment. When created without new, the String is stored in a string constant pool for reuse. If two String variables contain the same value without new, they will reference the same object. But Strings created with new will always be distinct objects even if they have the same value. The equals() method can be used to compare the values of two String objects rather than using ==, which compares object references.
- Author
- NaveenKumar
- Language
- EN