Question: In java What is displayed by the following statements (when embedded in the main method)? System.out.println(2 + 3); System.out.println(2 + 3); System.out.println(2 + 3 =
In java
What is displayed by the following statements (when embedded in the main method)?
System.out.println(2 + 3);
System.out.println("2 + 3");
System.out.println("2 + 3 = " + 2 + 3);
System.out.println("2 + 3 = " + (2 + 3));
The plus sign has two meanings (we say it is "overloaded"). What are the two meanings? Explain why the 1st and 2nd statements produce different results. Explain why the 3rd and 4th statements produce different results.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
