Languages-Java [3i Infotech Placement]: Sample Questions 68 - 70 of 141

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 68

Edit

Write in Short

Short Answer▾

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 69

Appeared in Year: 2004

Question

MCQ▾

Ejb Create () method of CMP bean returns

Choices

Choice (4)

a.

Primary Key class

b.

Null

c.

Home Object

d.

Remote 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 70

Edit

Describe in Detail

Essay▾

What is an interface?

Explanation

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. }

Developed by: