Pass the GIAC GIAC Certification GSSP-Java Questions and answers with CertsForce

Viewing page 2 out of 9 pages
Viewing questions 11-20 out of questions
Questions # 11:

Mark works as a Programmer for InfoTech Inc. He develops the following deployment descriptor code for specifying the security roles for a Web application.

Manager

Admin

Member

Which of the following are the valid <auth-constraint> element that will allow the users to access resources constrained by the security role declared given above?

Each correct answer represents a complete solution. Choose all that apply.

Options:

A.

<auth-constraint>

*

</auth-constraint>


B.

<auth-constraint/>


C.

<auth-constraint>

Admin

Manager

</auth-constraint>


D.

<auth-constraint>

admin

</auth-constraint>


E.

<auth-constraint>

Admin

</auth-constraint>


F.

<auth-constraint>

Manager

</auth-constraint>


Questions # 12:

Which of the following statements about a filter are true?

Each correct answer represents a complete solution. Choose all that apply.

Options:

A.

Like a servlet, a filter is also declared in the deployment descriptor.


B.

The life cycle of a filter is managed by the container.


C.

The life cycle of a filter has three methods, namely init(), service(), and destroy().


D.

Every filter must implement the Filter interface.


Questions # 13:

Which of the following statements about serialization are true?

Each correct answer represents a complete solution. Choose all that apply.

Options:

A.

Transient variables cannot be serialized.


B.

Externalizable is a marker interface and does not define any method.


C.

Serializable is a marker interface and does not define any method.


D.

Static variables cannot be serialized.


Questions # 14:

Which of the following methods is defined by ObjectOutputStream?

Options:

A.

char readChar()


B.

int readInt()


C.

void write(byte buffer[])


D.

int available()


Questions # 15:

Which of the following statements about the isUserInRole() method are true?

Each correct answer represents a complete solution. Choose all that apply.

Options:

A.

It accepts a boolean argument.


B.

It is mapped in the deployment descriptor using the element.


C.

It belongs to the HttpServletResponse interface.


D.

The sub-element of the element must match the sub-element of the element.


Questions # 16:

Which of the following statements are true about Vector and ArrayList?

Each correct answer represents a complete solution. Choose all that apply.

Options:

A.

ArrayList is synchronized and Vector is not synchronized.


B.

Each vector tries to optimize storage management by maintaining a capacity and a

capacityIncrement.


C.

If multiple threads are trying to access an ArrayList instance concurrently, and at least one of the threads modifies the list structurally, it must be synchronized externally.


D.

Vector is an implementation of the List interface and implements all optional list operations, and permits all elements, excluding null.


Questions # 17:

Mark works as a Programmer for InfoTech Inc. He develops a code snippet for a class named

servletClassA that extends the HttpServlet class. Which of the following HttpServlet class methods are not required to be overridden by the servletClassA?

Each correct answer represents a complete solution. Choose all that apply.

Options:

A.

doDelete()


B.

doPost()


C.

doGet()


D.

doOptions()


E.

service()


Questions # 18:

Mark works as a Programmer for InfoTech Inc. He develops the following code snippet.

import java.util.*;

public class DemoSet{

public static void main(String[] args){

TreeSet ts = new TreeSet();

ts.add("Sunday");

ts.add("Friday");

ts.add("Wednesday");

ts.add("Sunday");

ts.add("Monday");

Iterator it = ts.iterator();

while(it.hasNext()){

System.out.print(it.next() + " ");

}

}

}

What will be the output when he tries to execute the given code snippet?

Options:

A.

Wednesday Sunday Monday Friday


B.

An exception will be thrown at runtime.


C.

Friday Monday Sunday Wednesday


D.

Sunday Monday Wednesday Friday


Questions # 19:

Which of the following exceptions will be thrown if a program fails to implement the Serializable interface?

Options:

A.

UnableToImplementException


B.

NonSerializableException


C.

NotSerializableException


D.

IllegalSerializationError


Questions # 20:

Which of the following statements are correct about the code given below?

AccountServlet

This is an Account Servlet.

GET

POST

PUT

DELETE

acme/AccountServlet

Each correct answer represents a complete solution. Choose all that apply.

Options:

A.

The delete http method is not allowed in the http-method element declaration.


B.

If no http-method is specified in the web-resource-collection element, the security restriction will be applied to all http methods.


C.

There should be at-least one url-pattern element otherwise, the will be ignored.


D.

It is necessary that the web-resource-name must be specified in the web-resource-collection element.


E.

It is not possible to define more than two http method in the web-resource-collection element.


F.

It is necessary that the web-resource-name must be specified in the url of the url-pattern element.


Viewing page 2 out of 9 pages
Viewing questions 11-20 out of questions