Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exam Lab Question doubt

 
Abhishek KumarSoni
Ranch Hand
Posts: 61
Chrome Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello friends Here line number is showing expected output which is 828 .But friend why output in line number 11 is ceene-abhi .It should follow rule followed in line number 10 and output should be -abhiceene().I mean -abhi should be calculated first thrn ceene should be added in it.
 
Heena Agarwal
Ranch Hand
Posts: 262
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would it change the output if the order of computation was not what you think it is? Whatever is in left will stay in left. Right?

Edit : --n is 1. So that expression becomes -
str[1] = str[1] + "-" + "abhi"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic