I am having a confusion here. I have String which I have assigned null to it. So when I concat a String anotherString="abc", it prints "nullabc". But if I try to do the same with a Character, as shown in code, I get a null pointer. I want to understand as to why its happening. I am new to Java and want to understand the nuances of the language.Any help appreciated. Thanks!
String nullString=null;
Character nullCharacter=null;
Character character=new Character('k');
Integer nullInteger=null;
System.out.println(nullString+"abcdefgh");//prints-"nullabcdefgh"
System.out.println(nullCharacter+character);// throws null pointer exception