What is the result?

Given:
1. <% int[] nums = {42,420,4200};
2. request.setAttribute(“foo”, nums); %>
3. ${5 + 3 It 6}
4. S(requestScope[‘foo’][0] ne 10 div0>
5. ${10 div 0}
What is the result?

Given:
1. <% int[] nums = {42,420,4200};
2. request.setAttribute(“foo”, nums); %>
3. ${5 + 3 It 6}
4. S(requestScope[‘foo’][0] ne 10 div0>
5. ${10 div 0}
What is the result?

A.
true true

B.
false true

C.
false true 0

D.
true true Infinity

E.
false true Infinity

F.
An exception is thrown

G.
Compilation or translation fails



Leave a Reply 4

Your email address will not be published. Required fields are marked *


pete

pete

Beware with errata:
${5 + 3 lt 6}
$(requestScope[‘foo’][0] ne 10 div 0>

Allan Santos

Allan Santos

Option E.
But the question should be like this.
${5 + 3 lt 6}
${requestScope[‘foo’][0] ne 10 div 0}
${10 div 0}

Allan Santos

Allan Santos

${requestScope[“foo”][0] ne 10 div 0}