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

GSSP-Java PDF

$38.5

$109.99

3 Months Free Update

  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions

GSSP-Java PDF + Testing Engine

$61.6

$175.99

3 Months Free Update

  • Exam Name: GIAC Secure Software Programmer - Java
  • Last Update: May 4, 2024
  • Questions and Answers: 275
  • Free Real Questions Demo
  • Recommended by Industry Experts
  • Best Economical Package
  • Immediate Access

GSSP-Java Engine

$46.2

$131.99

3 Months Free Update

  • Best Testing Engine
  • One Click installation
  • Recommended by Teachers
  • Easy to use
  • 3 Modes of Learning
  • State of Art Technology
  • 100% Real Questions included

GSSP-Java Practice Exam Questions with Answers GIAC Secure Software Programmer - Java Certification

Question # 6

Given the following directory structure.

GSSP-Java question answer

Assuming that the current directory is com, which of the below options can be used to create a jar file called TestJar.jar that contains all the files from the directory testApp?

A.

jar -zf TestJar.jar

B.

jar -cf TestJar.jar

C.

jar -tf TestJar.jar

D.

jar -cf TestJar.jar testApp

Full Access
Question # 7

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?

A.

Authentication

B.

Data integrity

C.

Confidentiality

D.

Authorization

Full Access
Question # 8

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

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

Full Access
Question # 9

Which of the following methods are used in the verification of a signature?

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

A.

initVerify

B.

update

C.

verify

D.

initSign

Full Access
Question # 10

Mark develops an application using Java language. He writes the following code snippet in the application.

public class mClass{

public static void main(String args[]){

try{

return;

}

finally{System.out.print("Finally");}}}

What will happen when Mark attempts to compile and execute the code snippet?

A.

The code snippet will compile successfully and the output will be displayed as "Finally".

B.

The code snippet will compile successfully, but an exception message will be displayed at runtime.

C.

A compile time error will occur because the catch block is not defined.

D.

The code snippet will compile successfully, but nothing will be displayed as output on execution.

Full Access
Question # 11

Which of the following circumstances can prevent the execution of code in a finally block?

Each correct answer represents a complete solution. Choose two.

A.

An exception arising in the try block that precedes the finally block.

B.

An exception arising in the finally block itself.

C.

No exception condition arising in the try block that precedes the finally block.

D.

The use of the System.exit(0); statement in the finally block.

Full Access
Question # 12

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.

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)

Full Access
Question # 13

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 element of the deployment descriptor.

1.

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

3. HR-Manager

4.

5.

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?

A.

B.

C.

D.

Full Access
Question # 14

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

package Mark.tutorial.javaee.ejb;

import java.util.logging.Logger;

import javax.annotation.Resource;

import javax.ejb.Stateless;

import javax.ejb.Timeout;

import javax.ejb.Timer;

import javax.ejb.TimerService;

@Stateless

public class TimerBean implements TimerSessionBean {

@Resource

TimerService timerService;

private static final Logger logger = Logger.getLogger

("com.sun.tutorial.javaee.ejb.timersession.TimerSessionBean");

public void createTimer(long intervalDuration) {

Timer timer = timerService.createTimer(intervalDuration, "New timer created");

}

@Timeout

public void timeout(Timer timer) {

logger.info("Timer Timeout");

}

}

which of the following statements are true about the code?

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

A.

The class Logger cannot be used with a stateless session bean.

B.

The EJB container will invoke the timeout method of TimerSessionBean when the timer expires.

C.

The class is using the createTimer method incorrectly because it creates a new timer.

D.

TimerBean is a stateless session bean that shows how to set a timer.

Full Access
Question # 15

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

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

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.

Full Access
Question # 16

Which of the following JAR file options is used for creating an archive?

A.

-v

B.

-u

C.

-x

D.

-c

Full Access
Question # 17

Which of the following is the return type of the getInitParameter() method of the ServletContext interface?

A.

Enumeration

B.

String

C.

String array

D.

ServletContext

E.

Integer

Full Access
Question # 18

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?

A.

SAXException

B.

NullPointerException

C.

IllegalArgumentException

D.

IOException

Full Access
Question # 19

You work as a programmer for PassGuide.Inc. You have a session object named session1 with an attribute named Attribute1, and an HttpSessionBindingEvent object binding1 bound to session1.

Which of the following will be used to retrieve Attribute1?

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

A.

Object obj=binding1.getSession().getAttribute("Attribute1");

B.

Object obj=binding1.getAttribute("Attribute1");

C.

Long MyAttribute=session1.getAttribute("Attribute1");

D.

String str1=session1.getAttribute("Attribute1");

E.

Object obj=session1.getAttribute("Attribute1");

Full Access
Question # 20

Which of the following exceptions is thrown if a class uses the clone() method but does not implement the Cloneable interface?

A.

CloneDoesNotExistException

B.

ClassNotFoundException

C.

CloneNotSupportedException

D.

NullPointerException

Full Access
Question # 21

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.

A.

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

B.

Annotate method doPrint() with @PermitAll.

C.

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

D.

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

Full Access
Question # 22

Which of the following elements can be used to obtain a database connection?

A.

B.

C.

D.

E.

Full Access
Question # 23

Which of the following methods causes the currently executing thread object to temporarily pause and allow other threads to execute?

A.

sleep()

B.

notify()

C.

finalize()

D.

interrupted()

E.

yield()

F.

notifyAll()

Full Access
Question # 24

The __________ interface accepts results from a SQL SELECT statement.

A.

Connection

B.

ResultSet

C.

PreparedStatement

D.

DatabaseMetaData

Full Access
Question # 25

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

A.

EJB JAD file

B.

Deployment descriptor

C.

META-INF directory

D.

EJB JAR file

Full Access
Question # 26

Which of the following statements are true?

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

A.

StringBuffer is thread safe, but StringBuilder is not.

B.

The String class is final.

C.

StringBuilder offers faster performance than StringBuffer.

D.

The size of the String can be obtained using the length property.

Full Access
Question # 27

The deployment descriptor uses the __________ element to pass control to an error page when an exception is thrown.

A.

B.

C.

D.

Full Access
Question # 28

Which of the following tags is used to include resources from within the same servlet container?

A.

B.

C.

D.

Full Access
Question # 29

Which of the following is a mandatory sub-element of the element of the deployment descriptor?

A.

B.

C.

D.

Full Access
Question # 30

You work as a Programmer for InfoTech Inc. You write the following code.

1. public class InnerDemo{

2. public static void main(String[] args) {

3. Car c = new Car();

4. // insert code here

5. e.test();

6. }

7. }

8. class Car{

9. class Engine{

10. void test() {System.out.println("test"); }

11. }

12. }

Which of the following options should you add to line 4 so that the code compiles and produces the output "test"?

A.

Car.Engine e = c.new Engine();

B.

Engine e = c. new Engine();

C.

c.Engine e = Car.new Engine();

D.

Car.Engine e = Car.new Engine();

Full Access
Question # 31

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?

A.

DriverManager

B.

ResultSet

C.

Connection

D.

Statement

Full Access
Question # 32

Which of the following rules must be followed while determining a class loader?

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

A.

A new instance of the AppletClassLoader is used while loading the first class of an applet.

B.

If the request to load a class is triggered by a reference to it from an existing class, the class loader for the existing class is asked to load the class.

C.

A new instance of the URLClassLoader is used while loading the first class of an application.

D.

The primordial class loader is used if java.lang.Class.ForName is directly called.

Full Access
Question # 33

Which of the following functions are performed by methods of the

HttpSessionActivationListener interface?

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

A.

Notifying the object when it is bound to a session.

B.

Notifying an attribute that a session has just migrated from one JVM to another.

C.

Notifying the object when it is unbound from a session.

D.

Notifying an attribute that a session is about to migrate from one JVM to another.

Full Access
Question # 34

Mark works as a Programmer for InfoTech Inc. He develops a Java application that uses the encryption and compression techniques. Which of the following interfaces will he use to control the serialization and deserialization processes?

A.

Flushable

B.

Closeable

C.

Serializable

D.

Externalizable

Full Access
Question # 35

You work as a Software Developer for BlueTech Inc. You create code using EJB 3.0. You want to ensure that each new record is checked for validation before it is inserted into the database. Which of the following callback methods will you use to write the logic for validation?

A.

PostUpdate

B.

PreUpdate

C.

PostLoad

D.

PrePersist

Full Access
Question # 36

Which of the following statements is true about the Java synchronized keyword?

A.

It prevents multiple threads from accessing a block of code at the same time.

B.

It allows the class to be loaded as soon as the JRE starts.

C.

It prevents multiple developers from code redundancy.

D.

It allows two different functions to execute in a shared manner.

Full Access
Question # 37

You work as a Software Developer for NewTech Inc. You want to configure the deployment descriptor so as to specify the error pages used in the FORM based authentication. Which of the following elements will you use to accomplish the task?

A.

The sub-element of the element.

B.

The sub-element of the element.

C.

The sub-element of the element.

D.

The sub-element of the element.

Full Access
Question # 38

You have written the following code snippet.

1. public class Read {

2. protected int ReadText(int x) { return 0; }

3. }

4. class Text extends Read {

5. /*insert code here*/

6. }

Which of the following methods, inserted independently at line 5, will compile?

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

A.

private int ReadText(long x) { return 0; }

B.

protected long ReadText(int x, int y) { return 0; }

C.

protected long ReadText(long x) { return 0; }

D.

protected int ReadText(long x) { return 0; }

E.

private int ReadText(int x) { return 0; }

F.

public int ReadText(int x) { return 0; }

G.

protected long ReadText(int x) { return 0; }

Full Access
Question # 39

You work as a programmer for PassGuide.Inc. You have a session object named session1 with an attribute named Attribute1, and an HttpSessionBindingEvent object binding1 bound to session1.

Which of the following will be used to retrieve Attribute1?

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

A.

Object obj=binding1.getSession().getAttribute("Attribute1");

B.

Object obj=binding1.getAttribute("Attribute1");

C.

Long MyAttribute=session1.getAttribute("Attribute1");

D.

String str1=session1.getAttribute("Attribute1");

E.

Object obj=session1.getAttribute("Attribute1");

Full Access
Question # 40

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.

A.

The isCallerInRole() method

B.

The getCallerPrincipal() method

C.

The @RolesAllowed("ADMIN") annotation

D.

The @PermitAll annotation

Full Access
Question # 41

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

A.

B.

C.

D.

Full Access