Labour Day Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: geek65

GSSP-Java GIAC Secure Software Programmer – Java Questions and Answers

Questions 4

You write the following code.

class Father {public void Method() {System.out.println("I am Father");}}

public class Son extends Father {public static void main(String argv[]) {Son son = new Son();son.Method();}

private void Method() {System.out.println("I am Son");}}

Which of the following will be the result, when you try to compile and run the code?

Options:

A.

I am Father will be displayed as the output.

B.

A runtime error will result.

C.

I am Son will be displayed as the output.

D.

The code will execute but without displaying any output.

E.

A compile-time error will result.

Buy Now
Questions 5

Which of the following are valid method signatures of the getInstance() method of the Policy class?

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

Options:

A.

getInstance(ProtectionDomain domain)

B.

static Policy getInstance(String type, Policy.Parameters params, Provider provider)

C.

getInstance(String type, Policy.Parameters params)

D.

static Policy getInstance(String type, Policy.Parameters params, String provider)

Buy Now
Questions 6

Which of the following options are available with jar files?

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

Options:

A.

M - Deletes an existing manifest file

B.

c - Creates a jar file

C.

o - Overrides an existing jar file

D.

0 - Stores a file without using zip compression

E.

m - Manipulates or updates an existing jar file

F.

u - Unzips a jar file

G.

M - Creates a manifest file

Buy Now
Questions 7

Mark works as a Programmer for InfoTech Inc. He wants to develop a JMS API application that is used as a messaging service application. He writes the following createSession() method.

session = connection.createSession(false, 2);

Which of the following statements are true about the syntax?

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

Options:

A.

The client acknowledges a consumed message by calling the message's acknowledge method.

B.

The acknowledge method can reduce session overhead by minimizing the work the session does to prevent duplicates.

C.

This method instructs the session to lazily acknowledge the delivery of messages.

D.

The session automatically acknowledges a client's receipt of a message.

E.

If a message consumer consumes eight messages and then acknowledges the fourth message delivered, all eight messages are acknowledged.

Buy Now
Questions 8

You have created a Java application that will retrieve and insert data into a database table. Which of the following objects will you use to pass the JDBC Driver to obtain a connection to the database server?

Options:

A.

DriverManager

B.

ResultSet

C.

Connection

D.

Statement

Buy Now
Questions 9

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

Buy Now
Questions 10

Which of the following actions can you take to seal two packages, PackageA and PackageB, in the JAR file MyJar.jar?

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

Options:

A.

Execute the following command.

jar cvf MyJar.jar Manifest.txt MyPackage/*.class

B.

Create a text file named Manifest.txt with the following contents.

Name. myCompany/*Sealed. true

C.

Execute the following command.

jar cmf MyJar.jar Manifest.txt MyPackage/*.class

D.

Create a text file named Manifest.txt with the following contents.

Name. myCompany/PackageA/Sealed. true

Name. myCompany/PackageB/

Sealed. true

Buy Now
Questions 11

Which of the following is the correct syntax for the JVM garbage collection?

Options:

A.

System.out.gc();

B.

System.gc();

C.

System.free();

D.

System.setGarbageCollection();

Buy Now
Questions 12

Which of the following code fragments will throw NumberFormatException?

Options:

A.

Double dbl = new Double(true);

B.

Character ch = new Character('A');

C.

Float flt = new Float("true");

D.

Boolean bool = new Boolean("123");

Buy Now
Questions 13

Which of the following mechanisms is closely related to authorization?

Options:

A.

Sending data so that no one can alter it on the way.

B.

Allowing access to a particular resource.

C.

Verifying username and password.

D.

Sending secret data such as credit card information.

Buy Now
Questions 14

You work as a Software Developer for UcTech Inc. You want to declare a security constraint in the deployment descriptor using the element. Which of the following can be the possible values for the element?

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

Options:

A.

CONFIDENTIAL

B.

ALL

C.

NONE

D.

INTEGRAL

Buy Now
Questions 15

Consider the given lines of codE.

package ucert

class memberaccess

{

public int mem = 10;

}

Which of the following can directly access the variable mem?

Options:

A.

Any class

B.

Any class that extends the memberaccess class

C.

Only the memberaccess class

D.

Any class in the package ucert

Buy Now
Questions 16

Which of the following statements is used to enclose a block of code in which an exception is likely to occur?

Options:

A.

break

B.

finally

C.

assert

D.

do

E.

try

F.

catch

Buy Now
Questions 17

Mark works as a Programmer for InfoTech Inc. He develops a Web application that takes input from users. Which of the following methods can be used by the client and server to validate the users input?

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

Options:

A.

Validation through Servlets on the server side

B.

Validation using JavaScript on the client side

C.

Validation through Java Applets on the client side

D.

Validation through XML on the server side

Buy Now
Questions 18

Identify whether the given statement is true or false.

"When an exception occurs in a try block, each catch statement following the try block is inspected in sequential order, and the last one whose type matches that type of exception is executed."

Options:

A.

False

B.

True

Buy Now
Questions 19

Which of the following listeners causes an object of the implementing class to be notified when it is added to or removed from a session?

Options:

A.

HttpSessionListener

B.

HttpSessionActivationListener

C.

HttpSessionAttributeListener

D.

HttpSessionBindingListener

Buy Now
Questions 20

In which of the following locations the helper classes of a session bean class reside?

Options:

A.

EJB JAD file

B.

Deployment descriptor

C.

META-INF directory

D.

EJB JAR file

Buy Now
Questions 21

Which of the following fields must be present in the login page when using the form-based authentication?

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

Options:

A.

get_pw

B.

user_pw

C.

j_login

D.

j_password

E.

j_pw

F.

j_username

Buy Now
Questions 22

Which of the following exceptions will be thrown by the validate method if the result type does not match the Source type, or if the specified source is neither SAXSource nor DOM Source?

Options:

A.

SAXException

B.

NullPointerException

C.

IllegalArgumentException

D.

IOException

Buy Now
Questions 23

Which of the following is a valid constructor for the DataInputStream class?

Options:

A.

DataInputStream(File file)

B.

DataInputStream(FileInputStream fin)

C.

DataInputStream(String str)

D.

DataInputStream(FileInputStream fin, int size)

Buy Now
Questions 24

Which of the following TextField constraints hides the input while a user is entering the data in the text box?

Options:

A.

ANY

B.

NUMERIC

C.

PASSWORD

D.

CONSTRAINT_MASK

Buy Now
Questions 25

Which of the following methods throws a SecurityException if the calling thread is not allowed to open a socket connection to the specified host and port number?

Options:

A.

checkDelete()

B.

checkExec()

C.

checkCreate()

D.

checkConnect()

Buy Now
Questions 26

Identify whether the given statement is true or false.

"When a Java program starts up, one thread begins running immediately."

Options:

A.

True

B.

False

Buy Now
Questions 27

Which of the following CLDC connector modes is used only for data input over a connection?

Options:

A.

READ_WRITE

B.

READ

C.

WRITE

Buy Now
Questions 28

Which of the following classes enables a programmer to create an object and protect its confidentiality with a cryptographic algorithm?

Options:

A.

MAC

B.

SealedObject

C.

KeyGenerator

D.

SecretKeyFactory

Buy Now
Questions 29

There are two threads defined in an application named "thread1" and "thread2". Which of the following options can be the direct cause of "thread1" becoming blocked?

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

Options:

A.

thread1 attempt to read from a file

B.

thread1 executes thread2.sleep(3000)

C.

thread2 executes thread1 sleep(3000)

D.

thread1 raises its own priority

E.

thread1 executes new Thread (someRunnable)

Buy Now
Questions 30

You have the following code fragment of a Java program named test.

12. public void getData(){

13. ArrayList numbers=new ArrayList();

14. for(int i=0; i<10;1++){

15. int value=i*((int i) Math.random());

16. Integer obj=new Integer(value);

17. numbers.add(obj);

18. }

19. System.out.println(numbers);

20. }

On which of the following lines of code will the object referenced by obj be eligible for garbage

collection?

Options:

A.

Line 18

B.

Line 19

C.

Line 17

D.

Line 20

Buy Now
Questions 31

Which of the following methods are used to customize object serialization so that the objects will be able to apply default serialization?

Each correct answer represents a complete solution. Choose two.

Options:

A.

readObject()

B.

setDefault()

C.

writeObject()

D.

getDefault()

Buy Now
Questions 32

Which of the following methods specifies which LoginModules should be used for a particular application, and in what order the LoginModules should be invoked?

Options:

A.

getLogger

B.

getConfiguration

C.

getResourceBundle

D.

getAppConfigurationEntry

Buy Now
Questions 33

You work as a Software Developer for UcTech Inc. You are building a Web site that will contain study materials on the Java language. The company wants that members can access all the pages, but nonmembers have only limited access to the Web site pages. Which of the following security mechanisms will you use to accomplish the task?

Options:

A.

Authentication

B.

Data integrity

C.

Confidentiality

D.

Authorization

Buy Now
Questions 34

Which of the following classes is an engine class designed to provide conversions between opaque cryptographic keys and allows you to build an opaque key object from a given key specification?

Options:

A.

KeyPair

B.

KeyFactory

C.

CertificateFactory

D.

KeyPairGenerator

Buy Now
Questions 35

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

Buy Now
Questions 36

You work as a Software Developer for UcTech Inc. You want to ensure that a class is informed whenever an attribute is added, removed, or replaced in a session. Which of the following is the event that you will use to accomplish the task?

Options:

A.

HttpSessionEvent

B.

HttpSessionAttributeEvent

C.

HttpAttributeEvent

D.

HttpSessionBindingEvent

Buy Now
Questions 37

You work as a Software Developer for TechnoZen Inc. You create an application using Java. You define a method, named myMethod. You also define a class, named myClass, within myMethod.

Which of the following rules governs the access to the variables of the enclosing method?

Options:

A.

myClass can access only final variables.

B.

myClass can access only static variables.

C.

myClass can access only transient variables.

D.

myClass can access any variable.

Buy Now
Questions 38

The java.util.logging package provides the classes and interfaces of the Java platform's core logging facilities. Which of the following are the main target uses of logs?

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

Options:

A.

Problem diagnosis by field service engineers

B.

Problem diagnosis by the development organization

C.

Problem diagnosis by end users and system administrators

D.

Problem diagnosis by developers

Buy Now
Questions 39

Mark works as a Programmer for InfoTech Inc. He develops an application named JavaServices. He wants to declare a security constraint that will restrict everything in the com/files directory so that security role of Admin can invoke any http methods on the resources. Which of the following element declarations will be used to accomplish the task?

Options:

A.

JavaServices

com/files

Admin

B.

JavaServices

com/files/*

Admin

C.

JavaServices

com/files/*

*

Admin

D.

JavaServices

com/files/*

Admin

Buy Now
Questions 40

Mark works as a Programmer for InfoTech Inc. He develops the following security-constraint code.

Manager

/acme/Manager/*

GET

POST

// code

Manager

/acme/Manager/*

GET

POST

// code

Which of the following element declarations of the will allow everybody to access the same resources?

Options:

A.

Place the following code in the second declaration.

*

B.

Place the following code in the first declaration.

Manager

Place the following code in the second declaration.

*

C.

Place the following code in the first declaration.

Manager

Place the following code in the second declaration.

ALL

D.

Place the following code in the first declaration.

Manager

Place the following code in the second declaration.

Buy Now
Questions 41

Which of the following code snippets will read the eighth byte of the file wRead.txt into the variable str?

Options:

A.

RandomAccessFile raf=new RandomAccessFile("wRead.txt");

raf.seek(8);int str=raf.readByte();

B.

FileInputStream fis=new FileInputStream("wRead.txt");

int str=fis.read(8);

C.

FileInputStream fis=new FileInputStream("wRead.txt");

fis.skip(8);int str=fis.read();

D.

FileInputStream fis=new FileInputStream("wRead.txt");

fis.skip(7);int str=fis.read();

Buy Now
Exam Code: GSSP-Java
Exam Name: GIAC Secure Software Programmer – Java
Last Update: May 8, 2024
Questions: 275
GSSP-Java pdf

GSSP-Java PDF

$28  $80
GSSP-Java Engine

GSSP-Java Testing Engine

$33.25  $95
GSSP-Java PDF + Engine

GSSP-Java PDF + Testing Engine

$45.5  $130