These are both fine for me:
Example 1:
Character newCharacter = 'c';
Example 2:
Character newCharacterOther = new Character('c');
But what are the differences?
In the first example, how does the Character class know to set its value to "c" without needing a constructor for that?
Does it use a factory method behind the scenes? Can someone please explain to me how the compiler knows what to do?
I have a provided an image of the constructor of the Character.class in java.lang.
It even says that it's deprecated and that it shouldn't be accessed like that, but I am still confused a bit.