3i Infotech Papers: Sample Questions 1012 - 1014 of 1245

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

Question number: 1012

» Languages » Java

Short Answer Question▾

Write in Short

How super () used with constructors?

Explanation

  • Super () is used to invoke a super class constructor.

  • super () constructor is used within the constructor of the sub class, as the very first statement.

  • Used when the super class constructor is to be invoked first. Example:

class SubClass

{

SubCLass ()

{

Super ();

}

}

Question number: 1013

» Languages » Java

Appeared in Year: 2004

MCQ▾

Question

Ejb Create () method of CMP bean returns

Choices

Choice (4) Response

a.

Remote Object

b.

Null

c.

Primary Key class

d.

Home Object

Answer

b.

Explanation

  • Return method for ejb Create () CMP bean is null. CMP stands for Container-managed persistence.

  • EJB container manages data by saving it to a designated resource- normally a database.

  • Data is defined in the container for it to be managed within the deployment descriptors.

  • Container manages the data by saving it to the database.

  • CMP fields are usually mapped in the orion-ejb-jar. xml similar to “Primary Key”- with complex primary key containing more than a single field.

Question number: 1014

» Languages » Java

Essay Question▾

Describe in Detail

What is an interface?

Explanation

The abstract class implements the interface.

The Abstract Class Implements the Interface.

The abstract class implements the interface.

  • An interface is a reference type in java- a collection of abstract methods.

  • An interface without definitions for all functions specifies the set of methods that the inheriting class has to implement.

  • Interface achieves abstraction and multiple inheritance in java representing a IS-A relationship.

Syntax:

  1. Interface <interface_name>
  2. {
  3.     // declare constant fields
  4.     // declare methods that abstract
  5.     // by default.
  6. }