What will happen if I use β β in joining a character in a string instead of using " ".
I have used β β here and got 150 instead of getting l* in this program
What will happen if I use β β in joining a character in a string instead of using " ".
I have used β β here and got 150 instead of getting l* in this program
Letβs consider this lines of codes (Java):
System.out.println("H"+"A"); //HA
System.out.println('H'+'a'); //169
First line is concatenation of H and A that will result in HA (String literal)
Second we are adding the values of two char that according to the ASCII Table H =72 and a =97 that means that we are adding 72+97 itβs like ('H'+'a') .
Letβs consider another case where we would have:
System.out.println("A"+'N');//AN
In this case we are dealing with concatenation of String A and char N that will result in AN .