how is possible
dagim
Level 2
how ? x=2 , y=4, in between ther is space ,z=0 i think the answer was 24 0
Under discussion
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Vadim “迪姆哥”
12 July 2023, 20:22
Execution of expression is from left to right, but expression inside parentheses have higher priority than outside it.
So in this case you need put (x+y) in parentheses, to let JVM summarize it first.
Correct expression will be:
Execution steps will be:
1. JVM will summarize x+y,
2. Then convert result of expression in parentheses to String,
3. Then convert z to String also,
4. Then concatenates Strings "6" and String "0" together - resulting String "60" 0