How are these declarations different from each other?
String s=\"MY PROFESSION\"; char c[]=\"MY PROFESSION\";
What about the memory allocation
If you see the docs,
String str = "abc"; is equivalent to: char data[] = {'a', 'b', 'c'}; // not 'abc' String str = new String(data);
More over String literals are very special in java
String is backed by a character array internally.
String
character