Which is true?

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?

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?

A.
the page will include the output false

B.
the page will include the output

C.
the page will report that the property roasted does not exist

D.
the page will report that the syntax of the useBean tag is incorrect

E.
the page will report that the syntax of the getProperty tag ls incorrect



Leave a Reply 4

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


manish

manish

A
coz
if u wanna output “true”
then code should be

Adriano Palomino

Adriano Palomino

the correct answer is A

Tiparega

Tiparega

Answer is not A, nor B, as for a Boolean, the getter should be “getRoasted”. “isRoasted” only works for boolean. I tested it (should be C I think, don’t remember)