Ask Question
14 October, 11:36

What is output with the statement System. out. println (x+y); if x and y are int values where x=10 and y=5? Group of answer choices 15 105 10 5 x+y An error since neither x nor y is a String

+4
Answers (1)
  1. 14 October, 12:21
    0
    15

    Explanation:

    Java's output statement can be used to print String values when the are enclosed in a pair of quotations marks (" "). Given that the values x = 10 and y=5 have been declared as integers, the statement:

    System. out. println (x+y); will output 10+15 = 15

    On the other hand consider if these variables x and y were declared as Strings like this;

    String x="10";

    String y = "5";

    Then the output of the statement System. out. println (x+y); will be 105
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “What is output with the statement System. out. println (x+y); if x and y are int values where x=10 and y=5? Group of answer choices 15 105 ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers