nerdexam
Oracle

1Z0-899 · Question #6

Given the JavaBean class: public class MyBean { private Boolean roasted = false; public MyBean () {} public Boolean isRoasted () { returned roasted } public void setRoasted (Boolean roasted) {…

The correct answer is A. the page will include the output false. See the full explanation below for the reasoning.

Question

Given the JavaBean class: public class MyBean { private Boolean roasted = false; public MyBean () {} public Boolean isRoasted () { returned roasted } public void setRoasted (Boolean roasted) { this.roasted = roasted; ] } Assume a controller has created an instance of this bean, called setRoasted (true), and inserted the bean into the application scope using the name "myBean". A JSP contains these two tags: <jsp: useBean id = "aBean" class = "MyBean" scope = "page" \ /> <jsp: getProprty name = "aBean" property = "roasted" \ /> Which is true?

Options

  • Athe page will include the output false
  • Bthe page will include the output
  • Cthe page will report that the property roasted does not exist
  • Dthe page will report that the syntax of the useBean tag is incorrect
  • Ethe page will report that the syntax of the getProperty tag ls incorrect

How the community answered

(23 responses)
  • A
    78% (18)
  • B
    4% (1)
  • C
    13% (3)
  • E
    4% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-899 Practice