String is always a popular topic in java. Beyond all question String is an object type. But sometimes it seems like a basic data type. Many website emphasize we should identify between one situation when we use String a = “abc” and the other when String a = new String(“abc”).
Why I say String sometimes looks like a basic data type. Let’s see a simple example first: