System.out.println(2+’ '+5);
This code ma kiasa 39 ho Gaya samaj Nahi Aya. please help me.
And " /t " iska matlab kya? please explain in detail.
Data type part 9
@Shobhan,
when you do
System.out.println(2+" "+5);
The output will be 2 5. Everything after " " is interpreted as a string.
When you do:
System.out.println(2+' '+5);
The output is 2 + ASCII value of (’ ') + 5 = 2 + 32+5 = 39
You can replace ’ ’ by ‘a’ and the output will be 2 + ASCII value of(‘a’) + 5 = 104
“/t” means a space of 4 space chars. 4 times ’ ’ is equal to 1 “/t”.
Like “/n” means new line. “/t” means 4 space chars.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.