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

Viewing page 5 out of 9 pages
Viewing questions 41-50 out of questions
Questions # 41:

Which of the following methods are overridden by the FileInputStream class?

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

Options:

A.

void reset()


B.

void write(int b)


C.

void flush()


D.

long skip(long numBytes)


Questions # 42:

Harry works as a Software Developer for SoftTech Inc. He has developed a Java application to perform various SQL statements such as INSERT, UPDATE, etc., against a database table named Employee. He has used the executeUpdate() method to perform various SQL queries and to know the exact affected rows in the database if any of the operations is performed against the database table.

Which of the following types of values is returned by this method?

Options:

A.

Double


B.

Integer


C.

Float


D.

String


Questions # 43:

You work as a Software Developer for NewTech Inc. You write a bean class using Enterprise

JavaBeans 3.0. The class uses the @DeclareRoles ("ADMIN, HR, DBA, USER") annotation to declare the security roles. The class contains a method named showResult(). You want to ensure that the ADMIN role is granted privilege to the showResult() method. Moreover, if a role that is not allowed to access the method tries to call the method, an error message must be shown. Assuming that there is no security-related element in the deployment descriptor, which of the following will you use to accomplish the task?

Each correct answer represents a part of the solution. Choose two.

Options:

A.

The isCallerInRole() method


B.

The getCallerPrincipal() method


C.

The @RolesAllowed("ADMIN") annotation


D.

The @PermitAll annotation


Questions # 44:

Which of the following statements about a JAR file are true?

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

Options:

A.

It cannot be accessed through a class path, nor they can be used by java and javac.


B.

It is used to compress and archive data.


C.

It can be moved from one computer to another.


D.

It is created by using the jar command.


Questions # 45:

Which of the following methods is used to encrypt or decrypt data in a single step?

Options:

A.

wrap()


B.

update()


C.

digest()


D.

doFinal()


Questions # 46:

In which of the following cases is the GET method used to retrieve information?

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

Options:

A.

Using a hyperlink inside a Web page.


B.

Using a form with no method definition.


C.

Adding the request parameter to the URL.


D.

Requesting to retrieve a large amount of data.


Questions # 47:

Which of the following sub-elements specifies which users in specified roles are permitted access to a resource collection?

Options:

A.


B.


C.


D.

<auth-constraint>


Questions # 48:

Which of the following statements are true?

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

Options:

A.

An inner class cannot be defined as private.


B.

An inner class cannot be defined as protected.


C.

An inner class can be defined as private.


D.

An inner class can extend another class.


Questions # 49:

Which of the following statements correctly describe the features of the singleton pattern?

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

Options:

A.

Singletons are used to control object creation by limiting the number to one but allowing the flexibility to create more objects if the situation changes.


B.

Singletons can only be stateless, providing utility functions that need no more information than their parameters.


C.

A singleton class may disappear if no object holds a reference to the Singleton object, and it will be reloaded later when the singleton is needed again.


D.

The behavior of a singleton can be obtained by static fields and methods such as

java.lang.Math.sin(double).


Questions # 50:

Mark works as a Programmer for InfoTech Inc. He creates a program that uses the following code.

1. class Book

2. {

3. Short f1= 15;

4. Book GetDetails(Book b1)

5. {

6. b1=null;

7. return b1;

8. }

9. public static void main(String args[])

10. {

11. Book b1 = new Book();

12. Book b2 = new Book();

13. Book b3 = b1.GetDetails(b2);

14. b1=null;

15. //code

16. }

17. }

How many objects will be eligible for garbage collection when line 15 is reached?

Options:

A.

It cannot be determined.


B.

1


C.

2


D.

0


Viewing page 5 out of 9 pages
Viewing questions 41-50 out of questions