tg-me.com/topJavaQuizExplain/120
Last Update:
What is the result of the program?
❌ A. 10
✅ B. 15
❌ C. 25
❌ D. Compiler error on line 3
❌ E. Compiler error on line 8
❌ F. None of the above
Explanation:
The code compiles successfully, so options D and E are incorrect. The value of a cannot be changed by the addToInt method, no matter what the method does, because only a copy of the variable is passed into the parameter x. Therefore, a does not change and the output on line 9 is 15.
BY Explanations “Top Java Quiz Questions”
Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283
Share with your friend now:
tg-me.com/topJavaQuizExplain/120