Ask Question
13 April, 12:14

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. 13 April, 12:33
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers