Weekend Sale - Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 65percent

Welcome To DumpsPedia

GSSP-Java Sample Questions Answers

Questions 4

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

1. public class Garbage

2. {

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

4. {

5. String line;

6. String first="it is a program";

7. String last="last argument";

8. String arg1=new String((args.length>0) ? "'" + args[0] + "'" . "no arguments");

9. line=arg1;

10. arg1=null;

11. line=first + line + last;

12. first=null;

13. System.out.println("line");

14. line=null;

15. last=null;

16. args=null;

17. }

18. }

Which of the following statements about the code snippet is true when an object is initially referenced with arg1, and it is eligible for garbage collection?

Options:

A.

After line 10.

B.

After line 15.

C.

After line 12.

D.

After line 11.

Buy Now
Questions 5

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

import java.util.*;

public class DemoSet{

public static void main(String[] args){

TreeSet ts = new TreeSet();

ts.add("Sunday");

ts.add("Friday");

ts.add("Wednesday");

ts.add("Sunday");

ts.add("Monday");

Iterator it = ts.iterator();

while(it.hasNext()){

System.out.print(it.next() + " ");

}

}

}

What will be the output when he tries to execute the given code snippet?

Options:

A.

Wednesday Sunday Monday Friday

B.

An exception will be thrown at runtime.

C.

Friday Monday Sunday Wednesday

D.

Sunday Monday Wednesday Friday

Buy Now
Questions 6

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

Buy Now
Questions 7

Which of the following statements make a message-driven bean different from a session bean?

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

Options:

A.

Multiple clients can be processed by a single message-driven bean.

B.

A message-driven bean has only one bean class.

C.

Clients do not access message-driven beans through interfaces.

D.

The EJB container can assign a message to any message-driven bean instance because all instances of a message-driven bean are equivalent.

E.

Data or conversational state for a specific client cannot be retained by message-driven bean instances.

Buy Now
Questions 8

Mark works as a Programmer for InfoTech Inc. He develops the following code for a Web application named JavaSecurity Application.

A JavaSecurity Application

...

Manager

Admin

Programmer

Admin

Employee

Which of the following will be the action of the container if the request is HttpServletRequest, and request.isUserInRole("Admin"); has been called in a servlet code?

Options:

A.

The container will throw a system exception.

B.

The container will return true.

C.

The container will throw an application exception.

D.

The container will return false.

Buy Now
Questions 9

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.

Buy Now
Questions 10

You work as programmer for PassGuide.Inc. You have purchased a Web application named

SecureProgrammer that uses the programmatic authorization, and the security roles that are not used in your organization. Which of the following deployment descriptor elements must you use so that the SecureProgrammer application can work with your organization?

Options:

A.

B.

C.

D.

Buy Now
Questions 11

Mark works as a Programmer for InfoTech Inc. He creates an error page named

PageDoesNotExist.jsp. He wants to ensure that the PageDoesNotExist.jsp page will always be displayed if the server cannot find the requested page or if the request is for a page that does not exist on the server. Which of the following error-page code declarations will be used?

Options:

A.

406

PageDoesNotExist.jsp

B.

405

PageDoesNotExist.jsp

C.

404

PageDoesNotExist.jsp

D.

503

PageDoesNotExist.jsp

Buy Now
Questions 12

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 13

Which of the following code fragments will compile without error?

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

Options:

A.

boolean a = false;

if(a)

System.out.println(a);

B.

int a = 10;

if(a != 10)

System.out.println(a);

C.

int a = 0;

if(a)

System.out.println(a);

D.

boolean a = true;

if(!a);

Buy Now
Questions 14

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 15

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 16

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 17

You work as a Programmer for InfoTech Inc. You develop two html pages named authenticate.jsp and error.jsp, which are deployed directly at the root of the Web application named Authentication. Which of the following deployment descriptor code declarations will be used to ensure that the error.jsp page will be displayed automatically if the client is not authenticated?

Options:

A.

FORM

/authenticate.jsp

/error.jsp

B.

FORM

/authenticate.jsp

/error.jsp

C.

FORM

/authenticate.jsp

/error.jsp

D.

FORM

/authenticate.jsp

/error.jsp

Buy Now
Questions 18

Which of the following are marker interfaces?

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

Options:

A.

The Clonable interface

B.

The Serializable interface

C.

The Comparable interface

D.

The Runnable interface

Buy Now
Questions 19

Mark works as a Programmer for InfoTech Inc. He develops a RefreshFailed.jsp page for a servlet. He wants that the RefreshFailed.jsp page will be displayed when the

javax.security.auth.RefreshFailedException is thrown. Which of the following error-page deployment descriptor element declarations will be used?

Options:

A.

javax.security.auth.RefreshFailedException

RefreshFailed.jsp

B.

javax.security.auth.RefreshFailedException

RefreshFailed.jsp

408

C.

javax.security.auth.RefreshFailedException

RefreshFailed.jsp

D.

javax.security.auth.RefreshFailedException

RefreshFailed.jsp

Buy Now
Questions 20

Which of the following classes is an engine class that provides an opaque representation of cryptographic parameters?

Options:

A.

DSAPublicKeySpec

B.

AlgorithmParameterGenerator

C.

DSAParameterSpec

D.

AlgorithmParameters

Buy Now
Questions 21

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 22

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?

Options:

A.

B.

C.

D.

Buy Now
Questions 23

For which of the following purposes is the AccessController class used?

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

Options:

A.

To determine most of the parameters of the Java sandbox and whether particular operations should be permitted or rejected.

B.

To decide whether an access to a critical system resource is to be allowed or denied, based on the security policy currently in effect.

C.

To mark code as being "privileged", thus affecting subsequent access determinations.

D.

To obtain a "snapshot" of the current calling context so that access-control decisions from a different context can be made with respect to the saved context.

Buy Now
Questions 24

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 25

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 26

Which of the following statements about exceptions in message-driven beans are true?

Each correct answer represents a complete solution. Choose two.

Options:

A.

Message-driven beans must not throw any application exception.

B.

The message-listener interface of a message-driven bean cannot generate system exceptions.

C.

The message-listener interface of a message-driven bean can throw the

java.rmi.RemoteException.

D.

The isCallerInRole() method called on a message-driven bean will throw an exception.

E.

Message-driven beans must not throw any checked exception.

Buy Now
Questions 27

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 28

Given the following directory structure.

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?

Options:

A.

jar -zf TestJar.jar

B.

jar -cf TestJar.jar

C.

jar -tf TestJar.jar

D.

jar -cf TestJar.jar testApp

Buy Now
Questions 29

Rachel works as a Software Developer for Vivanet Inc. She writes the following code using Java.

class catchexcp

{public static void metha()

{int x=4/0;System.out.print("Caught exception");}

public static void main(String args[])

{try{metha();}catch(ArithmeticException ae){System.out.print("Caught ArithmeticException");}finally{try{metha();}catch(ArithmeticException ae){System.out.print("ReCaught ArithmeticException");}}}}

What will happen when she tries to compile and execute the code?

Options:

A.

It will compile and execute and will display ReCaught ArithmeticException.

B.

It will not compile.

C.

It will compile but will throw an exception at runtime.

D.

It will compile and execute and will display Caught exception Caught ArithmeticException

ReCaught ArithmeticException.

E.

It will compile and execute and will display Caught exception ReCaught ArithmeticException.

F.

It will compile and execute and will display Caught ArithmeticException ReCaught

ArithmeticException.

Buy Now
Questions 30

Which of the following statements about the isUserInRole() method are true?

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

Options:

A.

It accepts a boolean argument.

B.

It is mapped in the deployment descriptor using the element.

C.

It belongs to the HttpServletResponse interface.

D.

The sub-element of the element must match the sub-element of the element.

Buy Now
Questions 31

Wilbert works as a Software Developer for Wintos Inc. He writes the following code.

1. public class tcf

2. {

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

4. {

5. try

6. {

7. int x = 5 / 0;

8. System.exit(0);

9. }

10. catch(ArithmeticException e)

11. {

12. System.out.println("Within catch");

13. }

14. finally

15. {

16. System.out.println("Within finally");

17. }

18. }

19. }

What will happen when he tries to compile and execute the code?

Options:

A.

It will compile and print Within catch as the output.

B.

It will compile and execute successfully but will not print anything.

C.

It will compile and print Within catch and Within finally as the output.

D.

It will compile and print Within finally as the output.

Buy Now
Questions 32

You work as a Web Deployer for UcTech Inc. You write the element for an application in which you write the sub-element as follows.

*

Who will have access to the application?

Options:

A.

No user

B.

It depends on the application.

C.

Only the administrator

D.

All users

Buy Now
Questions 33

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 34

Which of the following, in JDBC 2.0, are the sub interfaces of the Statement interface?

Each correct answer represents a complete solution. Choose two.

Options:

A.

ParsedStatement

B.

CompiledStatement

C.

PreparedStatement

D.

CallableStatemen

Buy Now
Questions 35

A security manager is an object that defines a security policy for an application. Which of the following is used by security managers to indicate security domains?

Options:

A.

Deployer

B.

Container provider

C.

Class loader

D.

Bean provider

Buy Now
Questions 36

Which of the following statements about the isCallerInRole() method are true?

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

Options:

A.

It can be called from the PostConstruct and PreDestroy callback methods of a stateful session bean.

B.

It is present in the UserTransaction interface.

C.

It cannot be called from a message-driven bean.

D.

It can be invoked only from the business method of an enterprise bean.

Buy Now
Questions 37

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.

Options:

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; }

Buy Now
Questions 38

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

Buy Now
Questions 39

Which of the following methods must be implemented by each subclass of the Permission class to compare permissions?

Options:

A.

hashcode

B.

implies

C.

newPermissionCollection

D.

equals

Buy Now
Questions 40

Which of the following authentication flag values will force authentication to continue to proceed down the LoginModule list, irrespective of whether the LoginModule succeeds or fails?

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

Options:

A.

Optional

B.

Composite

C.

Requisite

D.

Required

Buy Now
Questions 41

Which of the following code declarations are valid error-page declarations?

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

Options:

A.

java.lang.ArithmeticException

304

NumericalException.jsp

B.

304

NumericalException.jsp

C.

304

NumericalException.jsp

D.

java.lang.ArithmeticException

NumericalException.jsp

E.

304

NumericalException.jsp

Buy Now
Questions 42

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 43

You work as a Software Developer for UcTech Inc. You want to write a filter that will implement the Filter interface. Which of the following methods will you use to accomplish the task?

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

Options:

A.

doPostFilter()

B.

doGetFilter()

C.

doFilter()

D.

init()

E.

service()

Buy Now
Questions 44

Which of the following statements about programmatic security are true?

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

Options:

A.

The bean provider is responsible for writing code for programmatic security.

B.

It is also called as instance level security.

C.

It is implemented using methods of the EJBContext interface.

D.

It is implemented using the methods of the UserTransaction interface.

Buy Now
Questions 45

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 46

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 47

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"?

Options:

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

Buy Now
Questions 48

Which of the following web-resource element descriptions will be used if you want to restrict all URL's in the application and perform authentication for the http delete method?

Options:

A.

AccountServlet

/*

GET

DELETE

Manager

B.

*

GET

DELETE

Manager

C.

AccountServlet

/*

GET

DELETE

Manager

D.

AccountServlet

*

GET

DELETE

Manager

Buy Now
Questions 49

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 50

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 51

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)

Buy Now
Questions 52

John works as a Programmer for Technostar Inc. He writes the following code using Java.

1. class WrapperClass{

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

3. String str2 = Double.toString(12);

4. String str1 = Double.toHexString(12);

5. System.out.println(str1+str2);

6. }

7. }

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

Options:

A.

It will not compile because the Double class does not contain the toHexString() method.

B.

It will compile and execute successfully and will display 8p312 as the output.

C.

It will compile and execute successfully and will display 0x1.8p312.0 as the output.

D.

It will not compile because the Double class does not contain the toString() method.

Buy Now
Questions 53

Sam works as a Software Developer for Gentech Inc. He writes the following code.

1. class TryFinallyTest {

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

3. try {

4. int i=15/0;

5. System.out.println("Testing Try");

6. }

7. catch(ArithmeticException ae) {

8. System.out.println("Arithmetic exception");

9. }

10. System.out.println("Correct");

11. finally {

12. System.out.println("Must execute");

13. }

14. }

15. }

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

Options:

A.

It will compile successfully and run with output Arithmetic exception.

B.

It will compile successfully and run with output Must execute.

C.

It will compile successfully and run with output Correct.

D.

It will give a compile-time error.

Buy Now
Questions 54

Which of the following are advantages of client-side JavaScript?

Each correct answer represents a complete solution. Choose two.

Options:

A.

It is fast.

B.

It provides graphical components.

C.

It is secure.

D.

It provides form-validation at client side.

Buy Now
Questions 55

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 56

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

Buy Now
Questions 57

Which of the following deployment descriptor elements must contain the element as its mandatory sub-element?

Options:

A.

B.

C.

D.

Buy Now
Questions 58

What will be the output of the following program?

class Stringtest

{

public static void main(String args[])

{

String s= "test";

s.concat("paper");

System.out.println(s);

}

}

Options:

A.

It will display test.

B.

It will display testpaper.

C.

It will generate a compile-time error.

D.

It will display paper.

Buy Now
Questions 59

Maria works as a Software Developer for Bluetech Inc. She develops a class named Warden that needs to access a class named Hostel, which is deployed in a JAR named City.JAR. What will she do in order to enable the Warden class to have access to the Hostel class during compilation?

Options:

A.

She will place the JAR file in javaprog/City.JAR and set the class path environment to include javaprog/City.JAR/Warden.class.

B.

She will place the JAR file in javaprog/City.JAR and set the class path environment to include javaprog/City.JAR/Hostel.class.

C.

She will place the JAR file in $ JAVA_HOME/jre/lib/ext/City.JAR.

D.

She will place the JAR file in $ JAVA_HOME/jre/classes/City.JAR.

Buy Now
Questions 60

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

Options:

A.

auth-constraint

B.

user-data-constraint

C.

web-resource-collection

D.

login-config constraint

Buy Now
Questions 61

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 62

Which of the following annotations specifies the roles that are allowed to invoke a particular bean method?

Options:

A.

@DenyAll

B.

@RolesAllowed

C.

@RunAs

D.

@DeclareRoles

E.

@PermitAll

Buy Now
Questions 63

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 64

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

Options:

A.

String

B.

Integer

C.

Float

D.

Character

Buy Now
Questions 65

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

Options:

A.

sleep()

B.

notify()

C.

finalize()

D.

interrupted()

E.

yield()

F.

notifyAll()

Buy Now
Questions 66

Which of the following statements about the String, StringBuffer, and StringBuilder classes are true?

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

Options:

A.

The StringBuffer class offers faster performance than the StringBuilder class.

B.

The StringBuffer class is thread-safe while the StringBuilder class is not.

C.

A character in a string can be searched using the indexOf() operator.

D.

The return type of the trim() method present in the String class is void.

Buy Now
Questions 67

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 68

Which of the following modifiers is not an access modifier?

Options:

A.

protected

B.

abstract

C.

public

D.

private

Buy Now
Questions 69

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

Options:

A.

-v

B.

-u

C.

-x

D.

-c

Buy Now
Questions 70

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 71

Which of the following methods evaluates the global policy for the permissions granted to the

ProtectionDomain and tests whether the permission is granted?

Options:

A.

implies

B.

getPolicy

C.

isPolicy

D.

getType

Buy Now
Questions 72

Fill in the______blank with the required interface name to complete the statement below.

An object of the interface is provided by the container to invoke the next filter in a chain of filters.

Options:

Buy Now
Questions 73

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

Options:

A.

CloneDoesNotExistException

B.

ClassNotFoundException

C.

CloneNotSupportedException

D.

NullPointerException

Buy Now
Questions 74

Identify whether the given statement is true or false.

"An object becomes eligible for garbage collection when it becomes unreachable by any code."

Options:

A.

False

B.

True

Buy Now
Questions 75

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 76

Which of the following options directs the Java compiler to search files in the current directory?

Options:

A.

dir

B.

; (i.e. a semi colon)

C.

-d

D.

current

E.

. (i.e. a dot)

Buy Now
Questions 77

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 78

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
Questions 79

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

Options:

A.

B.

C.

D.

Buy Now
Questions 80

Which of the following is not a type of authentication?

Options:

A.

DIGEST

B.

CLIENT-CERT

C.

FORM

D.

BASIC

E.

FORM-CERT

Buy Now
Questions 81

Which of the following JDBC interfaces is described in the statement below?

"It provides support for executing SQL statements and stored procedures."

Options:

A.

Driver

B.

ResultSet

C.

PreparedStatement

D.

Connection

Buy Now
Questions 82

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
Exam Code: GSSP-Java
Exam Name: GIAC Secure Software Programmer – Java
Last Update: Sep 15, 2025
Questions: 275
$57.75  $164.99
$43.75  $124.99
$36.75  $104.99
buy now GSSP-Java