Get premium membership and access questions with answers, video lessons as well as revision papers.

Message dialogs can display a string.What do the following message dialogs display? JOptionPane.showMessageDialog(null, ‘’5’’ +...

      

Message dialogs can display a string.What do the following message dialogs display?
JOptionPane.showMessageDialog(null,
‘’5’’ + ‘’5’’ + 5 + 5);
JOptionPane.showMessageDialog(null,
‘’5’’ + ‘’5’’ + (5+5));

  

Answers


Davis
The message dialog displays the string 5555 and 5510 respectively.In the first case, we proceed from left to right, joining strings.in the second case, the brackets are performed first , resulting in the integer 10. Then the string-joining takes over.
Githiari answered the question on January 26, 2018 at 12:31


Next: Complete the following java program, adding assignments to split totalseconds into two variables : minutes and seconds Int totalSeconds = 307;
Previous: What are the final values of m, n and s in the following java program? Int m, n; String s; String v =’’3’’; m =Integer.parseInt(v + v + ‘’4’’); n...

View More Computer Studies Questions and Answers | Return to Questions Index


Learn High School English on YouTube

Related Questions