A sequence of characters “abc” in Java is an object that implements an instance of String class, meaning this string object stores only the reference of this object in memory rather than the actual value.
Definition of String class:
public final class String
extends Object
implements Serializable, Comparable<String>, CharSequence
//Declaration using string literal
String str = "abc";
String anotherStr = "abc";//This is equivalent to below declaration
//done using new Keyword.
char data[] = {'a', 'b', 'c'};
String strNew = new String(data);
When a new object is created like in above declaration, JVM (Java Virtual Machine) firstly looks in “String…
The famous story of Cleopatra’s pearls as told by Pliny the Elder in his Natural History where she dissolved a pearl from her earring in a goblet of wine (or vinegar) and gulped it at the legendary banquet where she had bet Marc Antony that she could host the most expensive dinner in history.
Pearls have always been considered the ultimate symbol of wealth and social standing. Long before the written history, pearls were probably discovered by a bunch of humans searching for food by seashore. Fast forward to today, pearls are “cultivated” at large scales given the studies and…
Techie on a mission to save the planet 🌏👩💻