Shweta Verma wrote:I am not sure how this output comes??
Please explain the logic behind this question.
Remember that, in Java, everything is pass by value. This is a very important concept in Java. So a good solid understanding is required to pass the exam. So you'll probably want to read this excellent article as well. And in this topic you'll find an excellent explanation (with code examples) about this concept too. So definitely worth reading! And if you would still have doubts or questions, don't be shy and just hit the reply button
Hope it helps!
PS. Always use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information. Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers. Jeanne already added the code tags for you. See how much easier the code is to read?