nerdexam
Oracle

1Z0-899 · Question #118

You are writing a JSP that includes scriptlet code to declare a List variable and initializes that variable to an ArrayList object.Which two JSP code snippets can you use to import these list types?

The correct answer is C. <%@ page import='java.util.List' import='java.util.ArrayList' %> E. <%@ page import='java.util.List,java.util.ArrayList' %>. See the full explanation below for the reasoning.

Question

You are writing a JSP that includes scriptlet code to declare a List variable and initializes that variable to an ArrayList object.Which two JSP code snippets can you use to import these list types?

Options

  • A<%! import java.util.*; %>
  • B<%! import java.util.List; import java.util.ArrayList; %>
  • C<%@ page import='java.util.List' import='java.util.ArrayList' %>
  • D<%@ import types='java.util.List' types='java.util.ArrayList' %>
  • E<%@ page import='java.util.List,java.util.ArrayList' %>
  • F<%@ import types='java.util.List,java.util.ArrayList' %>

How the community answered

(44 responses)
  • A
    7% (3)
  • B
    2% (1)
  • C
    75% (33)
  • D
    14% (6)
  • F
    2% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-899 Practice