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

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.

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.

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?

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.

Peter works as a Software Developer for Neon Inc. He is developing an application in Java. He declares an interface. Which of the following field declarations are valid within the body of an interface?

Each correct answer represents a complete solution. Choose three.

A.

final static int answer=42;

B.

public static int answer = 42;

C.

private final static int answer=42;

D.

public int answer=42;

E.

int answer;

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?

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.

You work as a Software Developer for NewTech Inc. You write a bean class called EmployeeBean. The class contains two methods, EmpSal() and EmpAttendance(). Both these methods can be accessed by the ADMIN role. The EmpSal() method can be accessed only by the HR role, while the EmpAttendance () method can be accessed only by the DBA role. You want the EmpAttendance() method to be accessed by the HR role also. However, no other roles in the class except ADMIN, DBA, and HR should be able to access the EmpAttendance() method. Which of the following steps will you take to accomplish the task?

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

A.

Use the element of the deployment descriptor and declare the as DBA.

B.

Use the @RunAs("ADMIN") annotation to allow the HR the privileges as ADMIN.

C.

Use the @RunAs("DBA") annotation to allow the HR the privileges as DBA.

D.

Use the element of the deployment descriptor to declare the role-name as DBA and the method-name as EmpAttendance.

E.

Use the @PermitAll annotation with the EmpAttendance() method to allow the HR to access the EmpAttendance() method.

Which of the following statements about various authentication mechanisms in J2EE are true?

A.

The FORM based authentication requires a user to possess a Public Key Certificate.

B.

The realm string of the BASIC authentication must reflect a security policy.

C.

In case of the CLIENT-CERT authentication, a base-64 encoded user name and password is used.

D.

The DIGEST authentication may or may not be supported for a J2EE 1.4 compliant Web container.

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

}

A.

public String GetDetails(){}

B.

Object GetDetails(){}

C.

long GetDetails(){}

D.

private String GetDetails(){}

Which of the following are correct if LoginContext enforces the requisite flag to each LoginModule in the configuration file?

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

A.

If LoginModule succeeds, authentication continues down the LoginModule list.

B.

If LoginModule succeeds or fails, authentication still continues to proceed down the LoginModule list.

C.

The LoginModule is required to succeed.

D.

If LoginModule fails, control immediately returns to the application (authentication does not proceed down the LoginModule list).

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?

A.

No user

B.

It depends on the application.

C.

Only the administrator

D.

All users

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?

A.

jar -zf TestJar.jar

B.

jar -cf TestJar.jar

C.

jar -tf TestJar.jar

D.

jar -cf TestJar.jar testApp