Java认证考试

One of the use cases in your web application uses many session-scoped attributes. At the end of the usecase, you want to clear out this set of attributes from the session object. Assume that this static variableholds this set of attribute names: 201.priv

题目

One of the use cases in your web application uses many session-scoped attributes. At the end of the usecase, you want to clear out this set of attributes from the session object. Assume that this static variableholds this set of attribute names: 201.private static final Set USE_CASE_ATTRS;  202.static { 203.USE_CASE_ATTRS.add("customerOID"); 204.USE_CASE_ATTRS.add("custMgrBean"); 205.USE_CASE_ATTRS.add("orderOID"); 206.USE_CASE_ATTRS.add("orderMgrBean"); 207.} Which code snippet deletes these attributes from the session object?()

  • A、session.removeAll(USE_CASE_ATTRS);
  • B、for( String attr : USE_CASE_ATTRS ){ session.remove(attr); }
  • C、for( String attr : USE_CASE_ATTRS ){session.removeAttribute(attr);}
  • D、for( String attr : USE_CASE_ATTRS ){session.deleteAttribute(attr);}
  • E、session.deleteAllAttributes(USE_CASE_ATTRS);
参考答案和解析
正确答案:C
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

( )on the shelf was missing.

A. One of the books

B. One of the book

C. None of book

D. One of book


正确答案:A

第2题:

One should always _____ facts.

A、base one's opinion on

B、base one's opinion in

C、base one opinion on

D、base one opinion in


参考答案:A

第3题:

——The chair needs repairing.——() you are sitting on.

A、So does the one.

B、So the one does.

C、The one does so.

D、The one so does


参考答案:A

第4题:

It is a common sense that the earth is ( ).

A、one of the suns’ planets

B、one of the sun's planets

C、one of the sun’s planet

D、one of the suns’ planet’s


参考答案:B

第5题:

( ) must have witnessed the robbery.

A、One of the passers-by

B、One of the passer-by

C、One of passer-by

D、One of passer-bys


参考答案:A

第6题:

() and I’ll get the work finished.

A、Have one more hour

B、One more hour

C、Given one more hour

D、I have one more hour


参考答案:B

第7题:

有以下程序

#include <stdio.h>

#include <string.h>

main()

{ char str[ ][20]={"One*World","One*Dream!"},*p=str[1];

printf("%d,",strlen(p));printf("%s\n",p);

}

程序运行后的输出结果是

A)9,One*World

B)9,One*Dream !

C)10,One*Dream !

D)10,One*World


正确答案:C

第8题:

I have only one pen and I am going to buy ____.

A、 the second

B、 one second

C、 a second one

D、 the second one


参考答案:C

第9题:

His paper is ( )I have seen in my life.

A、one of the bests

B、one of best's

C、one best

D、one of the best


参考答案:D

第10题:

The United States grows nearly _____ of the world's grain and supplies a half of all the exports of grain in the world.

A.one third

B.one fourth

C.one sixth

D.one seventh


正确答案:B

更多相关问题