1. Question: How many objects are created by the following code?
    Object a, b, c, d, e;
    e = new Object ();
    b = a = e;
    e = new Object ();

    A
    2

    B
    5

    C
    4

    D
    That code is invalid.

    Note: Not available
    1. Report
  2. Question: Which of these interfaces is the most applicable when creating a class that associates a set of keys with a set of values?

    A
    Collection

    B
    Set

    C
    Map

    D
    SortedSet

    Note: Not available
    1. Report
  3. Question: Which of the following is the correct syntax for creating a Session object?

    A
    HttpSession ses=request.getSession(true);

    B
    HttpSession ses=getSession(true);

    C
    HttpSession ses=request.getSession();

    D
    HttpSession ses=request.getSessionObject(true);

    E
    HttpSession ses=response.getSession(true);

    Note: Not available
    1. Report
  4. Question: Which statement is true about the given code?
    public class Test78 {
            public static void main(String[] args) throws Exception {
                    new JBean().setHeight(1).setWidth(2).setDepth(3).setDensity(9);
            }
    }
    class JBean {
            private int height, width, depth, density;
            public JBean setHeight  (int h) { this.height  = h; return this; }
            public JBean setWidth   (int w) { this.width   = w; return this; }
            public JBean setDepth   (int d) { this.depth   = d; return this; }
            public JBean setDensity (int d) { this.density = d; return this; }
    }

    A
    The code does not compile, because two setters have a formal parameter with the same name.

    B
    The setters of the JBean class are JavaBean-compliant.

    C
    The code compiles, but throws a NullPointerException at run-time.

    D
    The code compiles and runs.

    Note: Not available
    1. Report
  5. Question: Choose all valid forms of the argument list for the FileOutputStream constructor shown below:

    A
    FileOutputStream( FileDescriptor fd )

    B
    FileOutputStream( String n, boolean a )

    C
    FileOutputStream( boolean a )

    D
    FileOutputStream()

    E
    FileOutputStream( File f )

    Note: Not available
    1. Report
  6. Question: Which of the following methods should be invoked by the container to get a bean back to its working state?

    A
    EJBPassivate()

    B
    EJBActivate()

    C
    EJBRemove()

    D
    EJBOpen()

    E
    EJBActivation()

    Note: Not available
    1. Report
  7. Question: Select all true statements:

    A
    An abstract class can have non-abstract methods.

    B
    A non-abstract class can have abstract methods.

    C
    If a non-abstract class implements interface, it must implement all the methods of the interface.

    D
    If a non-abstract class inherits abstract methods from its abstract superclass, it must implement the inherited abstract methods.

    Note: Not available
    1. Report
  8. Question: Which option could be used to see additional warnings about code that mixes legacy code with code that uses generics?

    A
    -Xlint:unchecked

    B
    -Xlint:-unchecked

    C
    -Xswitchcheck or -Xlint:fallthrough depending on the version of Java

    D
    -classpath or -cp

    Note: Not available
    1. Report
  9. Question: Assuming the servlet method for handling HTTPGET requests is doGet(HttpServletRequest req, HTTPServletResponse res), how can the request parameter in that servlet be retrieved?

    A
    String value=req.getInitParameter(10);

    B
    String value=req.getInitParameter("product");

    C
    String value=res.getParameter("product");

    D
    String value=req.getParameter("product");

    Note: Not available
    1. Report
  10. Question: Which of these is not an event listener adapter defined in the java.awt.event package?

    A
    ActionAdapter

    B
    MouseListener

    C
    WindowAdapter

    D
    FocusListener

    Note: Not available
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd