Trusted by millions of Kenyans
Study resources on Kenyaplex

Get ready-made curriculum aligned revision materials

Exam papers, notes, holiday assignments and topical questions – all aligned to the Kenyan curriculum.

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

Answer Attachments

Exams With Marking Schemes

Related Questions