3i Infotech Papers: Sample Questions 855 - 856 of 1245

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

Question number: 855

» Languages » Java

Appeared in Year: 2004

MCQ▾

Question

Stateful Session beans contain

Choices

Choice (4) Response

a.

Remote Interface

b.

Bean Class

c.

Home Interface

d.

All a. , b. and c. are correct

Answer

d.

Explanation

  • A stateful session bean is a type of enterprise bean, which preserve the conversational state with client.

  • A stateful session bean as per its name keeps associated client state in its instance variables.

    • The home interfaces create session bean instance defining the create method for bean.

    • Remote interfaces provide business methods- EJB container intercepts method invocations calling the respective bean implementation method, or, in the case of create () with a stateless session bean, gets a bean instance from the pool (if possible).

  • EJB Container creates a separate stateful session bean to process client’s each request.

  • Each call from the client to the bean is a remote invocation using the Java Remote Method Invocation (RMI) API- argument parameters and return values are copied, serialized, and transmitted remotely.

    Remote calls give enterprise application scalability and accessibility but add network overhead.

Question number: 856

» Languages » Java

Essay Question▾

Describe in Detail

What is polymorphism?

Explanation

Understanding of polymorphism in image

Understanding of Polymorphism in Image

Understanding of polymorphism in image

  • Ability of an object to take on many forms is polymorphism.

  • Common use of polymorphism in OOP is for parent class to refer to a child class object- implements the concept of performing a single action by different ways.

  • There are two types of polymorphism in java: compile time polymorphism and runtime polymorphism.

  • Polymorphism in java can be done by method overloading or by method overriding.

  • Overloading static method in java is an example of compile time polymorphism.