3i Infotech Placement: Sample Questions 1124 - 1125 of 1245

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

Question 1124

Edit

Describe in Detail

Essay▾

What is a template?

Explanation

  • Template is foundation of generic programming, which involves writing code in independent of any particular type.
  • Provides blueprint for creating a generic class or a function.
  • Library containers like iterators and algorithms are examples of generic programming developed using templates.
  • For example a vector containing different kinds can be declared as vector < int > or < string > .

Two types of template:

Function Templates

  • Write a generic function that used for different data types.
  • Class Template
  • Function template, class templates are useful when a class defines are independent of data type.
Two Types of Template

Question 1125

Edit

Describe in Detail

Essay▾

Have you ever used Hash table and directory?

Explanation

Hash Table

  • Yes, we have ever used hash table in java.
  • It is an implementation of the key value pair of the data structure in the java.
  • Offers similar performance as arrays with numerical indices, but flexible in terms of key.

Directory

  • The concept of a directory in java can be accomplished using the file class.
  • This class provide listFile method whihc returns list File object for directory.
  • Represents file or subdirectories.

Developed by: