I have a problem understanding question 11 of chapter 8 (page 626) and the sample solution (page 638). I couldn't find a note on this topic on the ranch so far. The question text reads as follows:
Question (original text): Which of the following characteristics must a Java class have if it contains one or more EL functions? (Choose three.)
A. Instance variables matching the function attribute names
B. A no-argument constructor
C. A method that is public
D. A method that is static
E. A main method (signature: public static void main(String args))
F. A method that returns a nonvoid result
Question' (my interpretation): Given a class that has at least one method capable of being used as an EL function. What is true about this class? (Choose three).
A'. For each parameter [not "attribute"] of the function there exists an equally named instance field.
B'. The class has a no-argument constructor.
C'. The class owns a public method.
D'. The class owns a static method.
E'. The class owns a main() method, which has the signature ... [see E.]
F'. The class owns a method, where the return type is void.
According to the sample solution answers C., D., and E. are correct.
Given, that my interpretation is what the author intended, then I understand that the trivial statements C. and D. are true. (The reasoning for the falseness of statements A. and B. given in the sample solution supports my interpretation.) However, statement E. does not follow from the assumption. The sample solution says, that main() can be used as an EL function because it's mandatorily declared public and static. Obviously, this is a correct statement, but it's logically wrong to say: "Given a class that has at least one method capable of being used as an EL function. Hence, the class owns public static void main(String args)"; Exercise 8-3 (page 576ff) provides a counter-example.
I believe, that there are either two questions accidentially mixed together or that the author intended to ask "Which are true statements? (Choose two)" or "Which are wrong statements (Choose four)". Regrettably, the errata page (http://www.jbridge.co.uk/scwcdbook.html) gives no hint.
Thank you for reading this topic. I don't intend to waste your time. But I decided to document this topic in order to support colleagues who don't have enough time to do so or who are afraid of making a fool of themselves by asking a question like this.
I really am not sure how E is true. If you remove the hint of no. of correct options then I interpret the question as asking what is a MUST for a function to qualify for being an EL function.
So the obvious options are C and D.
But E ???
subject: Doubt in Question 11 of Chapter 8 (page 626) in Bridgewaters SCWCD Study Guide