when I am working on the code given below NullPointerException is throwing ..
That is because you are trying to invoke a method of an object which is null
String result= A.concat(B);
But when I am trying with this output nullnull is coming
You have the following code:
String A=null;
String B=null;
String result= A+B;
System.out.println(result);
The println method checks if the String is null. If it is, it allocates the
value "null" (
String value) to the null String. That is why you get nullnull.