Computer Science, asked by sirigopal15, 7 hours ago

System.out.println('A'+10+'B')​

Answers

Answered by purveshKolhe
3

\huge{\green{\underbrace{\overbrace{\blue{\mathfrak{answer::}}}}}

\huge{\textsf{\underline{Given C0de::}}}

System.out.println("A"+10+"B")

\huge{\textsf{\underline{0utput::}}}

A10B

\huge{\underline{\textsf{Why???}}}

In the println method, given first is a string. The string, if added to a number, gets concatenated.

\huge{\underline{\textsf{Another Example::}}}

System.out.println(5 + 3 + 7)

System.out.println(5 + 3 + "B")

\huge{\textsf{\underline{0utput::}}}

15

8B

==> It gets added by order. Number added to number gives away sum(5 + 3). Number added to string gets concatenated(8 + "B")

I hope that you understand.

I hope that my answer helps you...

Mark this answer as brαinliest ;)​​​

Similar questions