EL Quiz 2S2C Home « EL Quiz 2

The questions in this quiz on Expression Language are on the topics covered in the second lesson of the EL section of the site. The table below lists the lesson used for each quiz, a description of the lesson content and the quiz number and questions associated with that lesson.

Click on a lesson in the table to go to that lesson for a refresher on the topics for that quiz.

Click on a quiz in the table to go straight to the quiz for a particular lesson.

EL Lessons Description Question Range
Lesson 1 - Introduction to ELIn our first lesson on the Expression Language we introduce EL and write our first JSP using EL.Quiz1
5 questions
Lesson 2 - EL OperatorsThis lesson is about the symbols used in EL for mathematical and logical manipulation which are known as EL operators.This quiz.
6 questions
Lesson 3 - EL Property AccessIn this lesson we learn how to use EL to access object properties and attribute values from any scope.Quiz3
5 questions
Lesson 4 - EL Implicit ObjectsIn this lesson we learn about EL implicit objects and their usage.Quiz4
5 questions
Lesson 5 - Configuring ELIn this lesson we finish our study of the Expression Language by looking at how we can configure our pages for script-free EL or non-EL use.Quiz5
5 questions

Expression Language Quiz

The quiz below tests your knowledge of the material learnt in the EL Operators lesson of the EL section of the site.

Question 1 : What will be the output from the following expression?

<%
   request.setAttribute("a", 15);
   request.setAttribute("b", 6);
%>
${a%b}

- When using modulo <code>%</code> or <code>mod</code> - the remainder is output which in this case is <code>3</code>.
Question 2 : When using the Short-circuit AND (and or &&) if the first operand returns false, the second operand will not be checked?
- When using the Short-circuit AND (<code>and</code> or <code>&&</code>) if the first operand returns false, the second operand will not be checked (short-circuited) and <code>false</code> is returned.
Question 3 : When using the Short-circuit OR (or or ||) if the first operand returns true, the second operand will not be checked?
- When using the Short-circuit OR (<code>or</code> or <code>||</code>) if the first operand returns <code>true</code>, the second operand will not be checked (short-circuited) and <code>true</code> is returned.
Question 4 : What will be the output from the following expression?

${empty ""}

- <code>true</code> will be returned from the expression <code>${empty ""}</code>.
Question 5 : What will be the output from the following conditional operator?

<%
request.setAttribute("a", 6);
request.setAttribute("b", 15);
%>
${(requestScope.a lt requestScope.b)? "lower number" : "higher number"}

- The conditional operator will output <code>lower number</code>.
Question 6 : Which operator has the highest precedence?
- The <code>not</code> operator has a precedence of 1 and so is the highest precedence.
Quiz Progress Bar Please select an answer

What's Next?

The next quiz is on EL Property Access.