The sl:shoppingList and sl:item tags output a shopping list 

题目
单选题
The sl:shoppingList and sl:item tags output a shopping list to the response and are used as follows: 11. 12. 13. 14. 15. The tag handler for sl:shoppingList is ShoppingListTag and the tag handler for sl:item is ItemSimpleTag.ShoppingListTag extends BodyTagSupport and ItemSimpleTag extends SimpleTagSupport.Which is true?()
A

ItemSimpleTag can find the enclosing instance of ShoppingListTag by calling getParent() and castingthe result to ShoppingListTag.

B

ShoppingListTag can find the child instances of ItemSimpleTag by calling super.getChildren() andcasting each to an ItemSimpleTag.

C

It is impossible for ItemSimpleTag and ShoppingListTag to find each other in a tag hierarchy becauseone is a Simple tag and the other is a Classic tag.

D

ShoppingListTag can find the child instances of ItemSimpleTag by calling getChildren() on thePageContext and casting each to an ItemSimpleTag.

E

ItemSimpleTag can find the enclosing instance of ShoppingListTag by calling findAncestorWithClass()on the PageContext and casting the result to ShoppingListTag.

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

顶风顶流情况下航行,船舶对水航程SL,对地航程SG,船速VE,航时t,则()。

A.SG

B.SL>VEt,且SL>SG

C.SG>SL>VEt

D.SLSL


本题答案:A

第2题:

importjava.util.*;

publicclassNameList{

privateListnames=newArrayList();

publicsynchronizedvoidadd(Stringname){names.add(name);}

publicsynchronizedvoidprintAll(){

for(inti=0;iSystem.out.print(names.get(i)+);

}

}

publicstaticvoidmain(String[]args){

finalNameListsl=newNameList();

for(inti=0;i<2;i++){

newThread(){

publicvoidruin(){

sl.add(”A”);

sl.add(”B”);

sl.add(”C”);

sl.printAll();

}

}.start();

}

}

}

Whichtwostatementsaretrueifthisclassiscompiledandrun?()


参考答案:E, F

第3题:

有风无流时,如计程仪改正率ΔL=0%,则相对计程仪航程(SL)和实际航程(SG)之间的关系为()。A.SL&g

有风无流时,如计程仪改正率ΔL=0%,则相对计程仪航程(SL)和实际航程(SG)之间的关系为()。

A.SL>SG

B.SL=SG

C.SL

D.视风的顺逆而定


本题答案:B

第4题:

目前我国水利水电工程施工质量检验与评定规程采用的标准是( )。

A.SL380-2007

B.SL176-2007

C.SL381-2007

D.SL385-2007


正确答案:B

第5题:

若有定义语句:

char}sl=‘’0K”,:It s2=”ok”;

以下选项中,能够输出“OK”的语句是( )。

A.if(strcmp(sl,s2)!=0)puts(s2);

B.if(strcmp(sl,s2)!=0)puts(s1);

C.if(strcmp(sl,s2)==1)puts(s1);

D.if(strcmp(sl,s2)==0)puts(s1);


正确答案:B
strcmp(sl,s2)是字符串比较函数,比较规则是两个字符串自左向右逐个字符相比(按照ASCIl码值大小),-以第一个不相同的字符的大小作为比较结果。因为。O。<10.,所以strcmp(sl,s2)为负值,只有B选项正确。

第6题:

Thesl:shoppingListandsl:itemtagsoutputashoppinglisttotheresponseandareusedasfollows:11.<sl:shoppingList>12.<sl:itemname="Bread"/>13.<sl:itemname="Milk"/>14.<sl:itemname="Eggs"/>15.</sl:shoppingList>Thetaghandlerforsl:shoppingListisShoppingListTagandthetaghandlerforsl:itemisItemSimpleTag.ShoppingListTagextendsBodyTagSupportandItemSimpleTagextendsSimpleTagSupport.Whichistrue?()

A.ItemSimpleTagcanfindtheenclosinginstanceofShoppingListTagbycallinggetParent()andcastingtheresulttoShoppingListTag.

B.ShoppingListTagcanfindthechildinstancesofItemSimpleTagbycallingsuper.getChildren()andcastingeachtoanItemSimpleTag.

C.ItisimpossibleforItemSimpleTagandShoppingListTagtofindeachotherinataghierarchybecauseoneisaSimpletagandtheotherisaClassictag.

D.ShoppingListTagcanfindthechildinstancesofItemSimpleTagbycallinggetChildren()onthePageContextandcastingeachtoanItemSimpleTag.

E.ItemSimpleTagcanfindtheenclosinginstanceofShoppingListTagbycallingfindAncestorWithClass()onthePageContextandcastingtheresulttoShoppingListTag.


参考答案:A

第7题:

下列程序段执行后,内存变量sl的值是( )。 s1="network"sl=stuff(sl,4,4,"BIOS&quo

下列程序段执行后,内存变量sl的值是( )。

s1="network"

sl=stuff(sl,4,4,"BIOS")

? s1

A.network

B.netBl0S

C.net

D.BIOS


正确答案:B
B。【解析】子串替换函数STUFF(<字符表达式1>,<起始位置>,<长度>,<字符串表达式2>)的含义如下:用<字符串表达式2>值替换<字符表达式1>中由<起始位置>和<长度>指明的一个子串。

第8题:

顺风顺流情况下航行,船舶对水航程SL,对地航程SG,船速VE,航时t,则()。

A.SG

B.SL>VEt,且SL>SG

C.SG>SL>VEt

D.SLSL


本题答案:C

第9题:

下列程序段执行后,内存变量sl的值是( )。 s1="network" sl=stuff(sl,4,4,"BIOS") ? s1

A.network

B.netBl0S

C.net

D.BIOS


正确答案:B
B。【解析】子串替换函数STUFF(<字符表达式1>,<起始位置>,<长度>,<字符串表达式2>)的含义如下:用<字符串表达式2>值替换<字符表达式1>中由<起始位置>和<长度>指明的一个子串。

第10题:

If Mary()shopping this afternoon, please ask her to write a shopping list first.

Awill go

Bgoes 

Cwent

Dhas gone


B

更多相关问题