Computer Associates Papers: Sample Questions 15 - 16 of 18

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 15

» Scripts- Server Side » JSP

Appeared in Year: 2004

MCQ▾

Question

EJB class should implement

Choices

Choice (4) Response

a.

javax. Ejb. EJBHome

b.

javax. Ejb. EJBObject

c.

javax. Ejb. EntityBean

d.

javax. Ejb. Rmi

Answer

c.

Explanation

EJB Implementation:

Image of the EJB Implementation

Image of the EJB Implementation

Image of the EJB Implementation

  • An entity bean is a remote object that manages its data persistently through callback methods, which are defined in the javax. ejb. EntityBean interface.

  • When you implement the EntityBean interface in your bean class, you develop each of the callback functions as designated by the type of persistence that you choose: bean-managed persistence or container-managed persistence.

  • The container invokes the callback functions at designated times, to manage the bean and its persistent data.

Question number: 16

» Scripts- Server Side » JSP

Appeared in Year: 2004

MCQ▾

Question

What is legal about JSP scriplets

Choices

Choice (4) Response

a.

A loop can begin in 1 Scriptlet and end in another

b.

Statements in Scriptlets should follow Java Syntax

c.

Semicolon is needed at the end of each statement in a Scriptlet

d.

All a. , b. and c. are correct

Answer

d.

Explanation

  • A JSP scriptlet is used to contain any code fragment that is valid for the scripting language used in a page.

  • The syntax for a scriptlet is as follows:

    < %

    Scripting-language-statements

    % >

  • When the scripting language is set to java, a scriptlet is transformed into a Java programming language statement fragment and is inserted into the service method of the JSP page’s servlet.

  • A programming language variable created within a scriptlet is accessible from anywhere within the JSP page.