Why does new String(“”) compile while char c = ” does not?

Because char represents a single character, which '' isn’t. A String can contain zero or more characters, but a character cannot be anything other than a single character.

Leave a Comment