Summer Special 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: bestdeal

Free GIAC GSSP-Java Practice Exam with Questions & Answers | Set: 5

Questions 41

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

GIAC GSSP-Java Premium Access
Questions 42

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.

Questions 43

Mark works as a Programmer for InfoTech Inc. He develops an application named AccountServlet. He wants to ensure that no body can access his application, i.e., he does not want any role to have access on his application. He defines the following security constraint for his application.

<security-constraint>

<web-resource-collection>

<web-resource-name>AccountServlet</web-resource-name>

/acme/Account

<http-method>GET</http-method>

<http-method>PUT</http-method>

</web-resource-collection>

//code

</security-constraint>

Which of the following options will be used to secure his application?

Options:
A.

<auth-constraint/>

B.

Skip the <auth-constraint> element in the security constraint code.

C.

<auth-constraint>

*

</auth-constraint>

D.

<auth-constraint>

NONE

</auth-constraint>

Questions 44

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();

Questions 45

You work as a developer for PassGuide Inc. You have implemented a session bean with a method doPrint(), which behaves differently depending on the caller's security role. Only MANAGER in the security roles "ADMIN" and "MANAGER" are allowed to call the method. Which of the following actions are appropriate to accomplish if there is no security-related metadata in the deployment descriptor?

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

Options:
A.

If EJBContext.getCallerPrincipal returns role "ADMIN", implement the behavior for MANAGER in role ADMIN.

B.

If EJBContext.isCallerInRole("ADMIN") returns true, implement the behavior defined for MANAGER in role "ADMIN".

C.

Annotate method doPrint() with @RolesAllowed({"ADMIN","MANAGER"}).

D.

Annotate method doPrint() with @PermitAll.

Questions 46

You work as a programmer for PassGuide.Inc. You want to create a servlet filter that stores all request headers to a database for all requests to the Web application's home page "/work.jsp". Which of the following HttpServletRequest methods allows you to retrieve all of the request headers?

Options:
A.

java.util.Enumeration getRequestHeaders()

B.

java.util.Enumeration getHeaderNames()

C.

String[] getRequestHeaders()

D.

java.util.Iterator getRequestHeaders()

E.

java.util.Iterator getHeaderNames()

F.

String[] getHeaderNames()

Questions 47

You work as a Software Developer for UcNet Inc. You write the following code using Java.

class StringTest

{

public static void main(String args[])

{

String s = "Hi";

s.concat("There");

System.out.println(s);

}

}

What will happen when you try to compile and execute the code?

Options:
A.

It will not compile.

B.

It will compile and execute successfully and will display Hi as the output.

C.

It will compile but will throw an exception at runtime.

D.

It will compile and execute successfully and will display HiThere as the output.

Questions 48

Roger works as a Software Developer for Tech Mart Inc. He creates an application using Enterprise JavaBeans. In the bean class, he writes a code snippet as follows.

Boolean b = ctx.isCallerInRole("Administrator");

The Application Assembler named Bob declares the following entries within the <entity> element of the deployment descriptor.

1. <security-role-ref>

2. The HR-Manager will have permission to access all the methods.

3. <role-name>HR-Manager

4.

5. </security-role-ref>

Bob wants to ensure that the HR-Manager declared in the deployment descriptor has all the privileges of an administrator. Which of the following elements should Bob declare in line 4 while deploying the bean?

Options:
A.

<security-role>

B.

<role-link>

C.

D.

Questions 49

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)

Questions 50

Mary works as a Software Developer for ABC Solutions Inc. She writes the following code.

public class StringMethods {

public static void main(String[] args) {

String str = new String("abc");

str.concat("xyz");

StringBuffer strBuf = new StringBuffer(" 123");

strBuf.append(" no");

System.out.println(str + strBuf);}}

What will be the output when Mary tries to compile and execute the code?

Options:
A.

Compilation will fail.

B.

The program will print abc xyz 123 no when run.

C.

The program will print xyz 123 no when run.

D.

The program will print abc 123 no when run.

Exam Code: GSSP-Java
Certification Provider: GIAC
Exam Name: GIAC Secure Software Programmer – Java
Last Update: Sep 12, 2025
Questions: 275

GIAC Related Exams

How to pass GIAC G2700 - GIAC Certified ISO-2700 Specialist Practice Test Exam
How to pass GIAC GCFW - GIAC Certified Firewall Analyst Exam
How to pass GIAC GCPM - GIAC Certified Project Manager Certification Practice Test Exam
How to pass GIAC GISF - GIAC Information Security Fundamentals Exam
How to pass GIAC GISP - GIAC Information Security Professional Exam
How to pass GIAC GSSP-.NET - GIAC GIAC Secure Software Programmer - C#.NET Exam
How to pass GIAC GSSP-NET-CSHARP - GIAC GIAC Secure Software Programmer - C#.NET Exam

GIAC Free Exams

GIAC Free Exams
Prepare for GIAC certification with free access to reliable study resources and practice tests at Examstrack.