Ask Question
15 June, 09:10

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

+1
Answers (1)
  1. 15 June, 09:14
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers