Languages [3i Infotech Placement]: Sample Questions 29 - 31 of 546

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

Question 29

Edit

Describe in Detail

Essay▾

How is linked list implemented?

Explanation

Understanding of Implimentation of Linked List
  • Linked list is made from nodes.
  • A node has two fields:
    • Object field holds the actual data
    • Next (pointer) holds starting location of the next node.
  • Head points to the first node.
  • Last node typically points to NULL.

Question 30

Languages
Edit

Statement

True-False▾

Java supports multiple inheritances?

Answer

FALSE

Explanation

Java Does Not Support Multiple Inheritance
  • False
  • Java does not allow multiple inheritances to avoid the ambiguity (see diagram above) .
  • Multiple inheritance happens when a class extends more than one superclass.

Question 31

Languages
Edit

Describe in Detail

Essay▾

What are adapter classes

Explanation

The Object Adapter Pattern
  • Provides the default implementation of an interface.
  • A class inheriting from adapter class is not forced to provide the implementation of all the methods of listener interface.
  • Useful for processing only few of the events- provide definition of only few functions in the interface relevant to us.

Advantages of the Adapter Class

  • Assists bringing together unrelated classes.
  • Increases transparency of classes.
  • Allows including related patterns in a class.
  • Provides a pluggable kit for developing applications.
  • Makes an interface highly reusable.

Example of adapter class:

Example of Adapter Class

Developed by: