Black Friday Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: cramtick70

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

Questions 4

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 5

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

class strconcat {public static void main(String args[])

{String str =" Correct answers";String perc ="a"+"b";System.out.println(80+ '%' + str);}}

Note. The ASCII value of % is 37.

Options:

A.

It will compile and execute successfully and will print 80 Correct answers as the output.

B.

It will compile and execute successfully and will print 117 Correct answers as the output.

C.

It will compile and execute successfully and will print 80% Correct answers as the output.

D.

It will fail to compile because % cannot be concatenated to a string.

Buy Now
Questions 6

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

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

Options:

A.

initVerify

B.

update

C.

verify

D.

initSign

Buy Now
Questions 7

You have the following code of a PreparedStatement.

PreparedStatement stm = con.prepareStatement("UPDATE EMPLOYEES SET SALARY = ? WHERE ID = ?");

Which of the following statements are true about a PreparedStatement?

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

Options:

A.

The executeUpdate() method executes the SQL query in the PreparedStatement object and returns the ResultSet object generated by the query.

B.

A PreparedStatement reduces execution time if it is required to execute the SQL statementmultiple times.

C.

When the executeQuery() method is used to execute a DDL statement, such as in creating a table, it returns the int 0.

D.

It is illegal for an instance of a PreparedStatement to contain a SQL statement that has already been compiled.

Buy Now
Questions 8

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 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.

*

B.

C.

Admin

Manager

D.

admin

E.

Admin

F.

Manager

Buy Now
Questions 9

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

interface A {public boolean b = false;}

class C implements A {public static void main(String args[]) {b = true;System.out.println(b);}}

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

Options:

A.

The code will compile and print false.

B.

The code will compile, but it will not execute.

C.

The code will compile and print true.

D.

The code will not compile.

Buy Now
Questions 10

Which of the following statements about ServletContext attributes is true?

Options:

A.

They are not thread-safe but can be made thread-safe by synchronizing the service() method.

B.

They are not thread-safe but can be made thread-safe by applying a lock on the context.

C.

They are thread-safe.

D.

They are not thread-safe but can be made thread-safe by applying a lock on the servlet.

Buy Now
Questions 11

Which of the following pieces of codes will be placed at the line XXX to successfully compile the given class?

public interface Publication

{

String GetDetails();

}

public class Book implements Publication

{

//line XXX

}

Options:

A.

public String GetDetails(){}

B.

Object GetDetails(){}

C.

long GetDetails(){}

D.

private String GetDetails(){}

Buy Now
Questions 12

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.

Buy Now
Questions 13

You work as a Software Developer for BlueWell Inc. Your team creates a Web site for online shopping.

All payments are made through credit cards. Hence, you want to ensure that the information transferred between the customers and your Web site is encrypted. Which of the following authentication mechanisms will you use to accomplish the task?

Options:

A.

FORM

B.

DIGEST

C.

BASIC

D.

CLIENT-CERT

Buy Now
Questions 14

Which of the following exceptions will be thrown if the name parameter is null in the constructor of AuthPermission?

Options:

A.

IllegalArgumentException

B.

NullPointerException

C.

ClassNotFoundException

D.

IllegalStateException

Buy Now
Questions 15

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 16

Which of the following exceptions will be thrown by the getFeature() method if the feature value cannot be assigned or retrieved?

Options:

A.

SAXNotSupportedException

B.

SAXNotRecognizedException

C.

NullPointerException

D.

IllegalArgumentException

Buy Now
Questions 17

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.

Buy Now
Questions 18

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 19

Which of the following classes of java.util.logging prints a brief summary of the LogRecord in a human readable format?

Options:

A.

XMLFormatter

B.

SimpleFormatter

C.

StreamHandler

D.

MemoryHandler

Buy Now
Questions 20

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 21

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.

Options:

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

Buy Now
Questions 22

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

Buy Now
Questions 23

Mark works as an Application Developer for XYZ Solutions Inc. He writes the following code.

public class TestDemo{public static void main(String[] args){

{try{int x =0;int d= 5/x;}catch(Exception ex){System.out.println("Exception");}

catch(ArithmeticException ae){System.out.println("Arithmetic Exception");}}}

What is the result when Mark tries to compile and execute the code?

Options:

A.

Exception

B.

An exception is thrown at runtime.

C.

Compilation fails.

D.

Arithmetic Exception

Buy Now
Questions 24

Which of the following methods of the EJBContext interface can be called by both the BMT and CMT beans?

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

Options:

A.

getCallerPrincipal()

B.

getRollbackOnly()

C.

getUserTransaction()

D.

isCallerInRole()

Buy Now
Questions 25

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 26

Which of the following methods of the HttpServletResponse interface is used for URL rewriting?

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

Options:

A.

encodeURL

B.

encodeRedirectURL

C.

sendRedirect

D.

getRequestURL()

Buy Now
Questions 27

What will be the output of the following code snippet?

class test22

{

public static void main(String args[])

{

String str= new String("Hello");

str.insert(3,"bye");

System.out.println(str);

}

}

Options:

A.

It will display Hello.

B.

It will display Helbyelo.

C.

It will throw NFE.

D.

It will generate a compile-time error.

Buy Now
Questions 28

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 29

Which of the following are valid thread state transitions?

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

Options:

A.

From running to ready.

B.

From ready to waiting.

C.

From running to waiting.

D.

From waiting to ready.

E.

From ready to running.

F.

From waiting to running.

Buy Now
Questions 30

Which of the following methods belongs to the FilterConfig interface and ServletConfig interface both?

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

Options:

A.

getInitParameter()

B.

getServletContext()

C.

getFilterName()

D.

getInitParameterNames()

Buy Now
Questions 31

The following JSP scriptlet is given.

<% response.setContentType("text/html; charset=ISO-8859-1"); %>

Which of the following directives is the equivalent directive for the scriptlet given above?

Options:

A.

<%@ include contentType="text/html; pageEncoding=ISO-8859-1" %>

B.

<%@ include contentType="text/html; charset=ISO-8859-1" %>

C.

<%@ page contentType="text/html; charset=ISO-8859-1" %>

D.

<%@ taglib contentType="text/html; pageEncoding=ISO-8859-1" %>

Buy Now
Questions 32

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

1. public class Header

2. {

3. //code//

4. {

5. System.out.println("Print the code.");

6. super.finalize();

7. }

8. }

Which of the following header statements should be placed at line 3 to execute the program

successfully?

Options:

A.

void finalize() throws Exception

B.

private void finalize() throws Exception

C.

protected void finalize() throws Throwable

D.

void finalize() throws Throwable

Buy Now
Questions 33

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.

Options:

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

Buy Now
Questions 34

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?

Options:

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.

Buy Now
Questions 35

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

Buy Now
Questions 36

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 37

Which of the following methods reinitializes the logging properties?

Options:

A.

reset

B.

addlogger

C.

reinitialize

D.

readConfiguration

Buy Now
Questions 38

Which of the following will be returned by the expression "string" instanceof String?

Options:

A.

0

B.

1.0

C.

null

D.

false

E.

0.0

F.

true

Buy Now
Questions 39

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 40

Which of the following data type values is returned by the System.in.read() console input function?

Options:

A.

String

B.

Character

C.

Float

D.

Integer

Buy Now
Questions 41

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.

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.

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

GSSP-Java PDF

$25.5  $84.99
GSSP-Java Engine

GSSP-Java Testing Engine

$30  $99.99
GSSP-Java PDF + Engine

GSSP-Java PDF + Testing Engine

$40.5  $134.99