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

Which of the following statements are correct about the code given below?

AccountServlet

This is an Account Servlet.

GET

POST

PUT

DELETE

acme/AccountServlet

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

A.

The delete http method is not allowed in the http-method element declaration.

B.

If no http-method is specified in the web-resource-collection element, the security restriction will be applied to all http methods.

C.

There should be at-least one url-pattern element otherwise, the will be ignored.

D.

It is necessary that the web-resource-name must be specified in the web-resource-collection element.

E.

It is not possible to define more than two http method in the web-resource-collection element.

F.

It is necessary that the web-resource-name must be specified in the url of the url-pattern element.

Which of the following statements about the element are true?

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

A.

It can have at the most one sub-element.

B.

It has as one of its sub-elements.

C.

If there is no sub-element, no HTTP method will be constrained.

D.

It is a sub-element of the element.

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?

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.

Which of the following init() method calls initializes a cipher object with a key in the SECRET_MODE?

A.

cipher.init(2, key);

B.

cipher.init(1, key);

C.

cipher.init(3, key);

D.

cipher.init(4, key);

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

1. class Alpha {

2. public static class Beta { }

3. }

4. class Delta {

5. // insert code here

6. }

Which of the following code statements can be inserted at line 5 to create an instance of the Beta class defined in the class Alpha?

A.

Beta b = new Beta();

B.

Alpha a = new Alpha();

C.

Beta = new a.Beta();

D.

The class Beta cannot be instantiated at line 5.

E.

Alpha.Beta b = new Alpha.Beta();

Which of the following statements about serialization are true?

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

A.

Transient variables cannot be serialized.

B.

Externalizable is a marker interface and does not define any method.

C.

Serializable is a marker interface and does not define any method.

D.

Static variables cannot be serialized.

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.

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

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

A.

A JAR file can be created without even using the f command.

B.

The 0 command is used for no compression of a JAR file.

C.

The t command of a JAR file is used to update the contents of a file.

D.

A JAR file can be extracted using the e command.

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

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

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.

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