3i Infotech Papers: Sample Questions 1000 - 1001 of 1245

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

Question number: 1000

» Languages » Java

Essay Question▾

Describe in Detail

Why does java not support multiple inheritance?

Explanation

Java supports multiple inheritance using interfaces.

Java Supports Multiple Inheritance Using Interfaces.

Java supports multiple inheritance using interfaces.

  • Common lisp and few other languages support multiple inheritance while java does not support.

  • Java does not allow multiple inheritances to avoid the ambiguity caused by it.

  • One of the examples of problem is the diamond problem that occurs in multiple inheritances.

  • Moreover, concrete classes have the option to implement multiple interface using single class.

  • Multiple interface inheritance allows an object to inherit many different method signatures with the caveat that the inheriting object must implement inherited methods.

Question number: 1001

» Languages » Java

Appeared in Year: 2004

MCQ▾

Question

Which of the following is true?

Choices

Choice (4) Response

a.

Stateless session beans doesn’t preserve any state across method calls

b.

Stateful session beans can be accesses by multiple users at the same time

c.

None of the above

d.

All of the above

Answer

a.

Explanation

  • A session bean encapsulates business logic that can be invoked programmatically by a client over local, remote, or web service client views.

  • To access an application that is deployed on the server, the client invokes the session bean’s methods.

  • The session bean performs work for its client providing encapsulation.

  • A stateless session bean is not persistent.

    • Stateless bean objects are pooled by the EJB container to service the request on demand.

    • In case of concurrent access, EJB container routes each request to a different instance.

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

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

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

3 important annotations are used in stateless session bean:

Image of 3 important annotations

Image of 3 Important Annotations

Image of 3 important annotations