移动端

  • 题王微信公众号

    微信搜“题王网”真题密题、最新资讯、考试攻略、轻松拿下考试

计算机考试 | Java认证考试

模式切换

0 0 0
我的错题 我的收藏 学习笔记

章节目录

单选题 A JSP page needs to perform some operations before servicing the first request. Where can this be done?()

A

 within a method called jspInit

B

 within the page directive of the JSP page

C

 within a scriptlet at the top of the JSP page

D

 within the  XML element

单选题 What is the result?()

A

 The program runs and prints “0”

B

 The program runs and prints “1”

C

 The program runs but aborts with an exception.

D

 An error “possible undefined variable” at line 5 cause compilation to fail.

E

 An error “possible undefined variable” at line 10 cause compilation to fail.

多选题 Assume the scoped attribute priority does NOT yet exist. Which two create and set new request-scoped attribute priority to the value “medium”?() 

A

 ${priority = ‘medium’ } 

B

 ${requestScope[ ‘priority’ ] = ‘medium’ } 

C

 <c:set var=priority” value=”medium” /> 

D

 <c:set var=”priority” scope=”request”>medium</C://set> 

E

 <c:set var=”priority” value=”medium” scope=”request” /> 

F

 <c:set property=”priority” scope=”request”>medium</c:set> 

G

 <c:set property=”priority” value=”medium” scope=”request” />

多选题 Upon a user’s first visit to the website, which two operations are always performed when the getSession method is called with no arguments in a servlet?()

A

 All URLs returned by the server are rewritten.

B

 An HttpSession object is created if necessary.

C

 The user name and password of the user are checked.

D

 The session ID is stored in the HTTP response as a cookie.

单选题 What is the result?()

A

 The program runs and prints “Hello”

B

 An error causes compilation to fail.

C

 The program runs and prints “Hello world!”.

D

 The program runs but aborts with an exception.

单选题 And command line is vacation: Java Test red green blue()

A

 bas has the value of “”.

B

 baz has the value of null.

C

 bas has the value of “red”.

D

 baz has he value of “blue”.

E

 baz has the value of “green”.

F

 the code does not compile.

G

 The program throws and exception.

多选题 AnInterface is an interface. AnAdapter0 is a non-abstract, non-final class with a zero argument constructor. An Adapterl is a non-abstract, non-final class without a zero argument constructor, but with a constructor that takes one int argument.   Which two construct an anonymous inner class()?

A

 AnAdapter1 aa = new AnAdapter1 () {}

B

 AnAdapter0 aa = new AnAdapter0 () {}

C

 AnAdapter0 aa = new AnAdapter0 (5) {}

D

 AnAdapter1 aa = new AnAdapter1 (5) {}

E

 AnInterface ai = new Anlnterface (5)) {}

单选题 Given an HttpServlet Request request and Http Servlet Response response, which sets a cookie “username” with the value “joe” in a servlet.?()

A

 request.add Cookie (“username”. “joe”)

B

 request.set Cookie (“username, “joe”)

C

 response.add Cookie (username”, “joe”))

D

 request.add Header (new Cookie (“username”, “joe”))

E

 request.add Cookie (new Cookie (“username”, “joe”))

F

 response.add Cookie (new Cookie (“username”, “joe”))

G

 response.add Header (new Cookie (“username”, “joe”))

1 2 3 4 5 下一页 尾页 /

到第