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
implements Serializable, Comparable<String>, CharSequence
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…