Technical Interview Questions and Answers :: Tech Mahindra

Topics List

  •  C
  •  C++
  •  DBMS
  •  Soft. Engineering
  •  Finite Automata
  •  SQL
  •  Java
  •  .NET
  •  WebMethod
  •  EDI
  •  Informatica
  •  Oracle Apps HRMS
  •  Operating System
  •  Data Structure
  •  PHP
  •  Unica
  •  Oracle Apex
  •  Networking
  •  Hadoop
  • 1. What is Inheritance?
  • Answer:

    Inheritance means, we use the methods or function or other public members of the parent class by child class. So to do this we have to extend the the parent class through it child class.
    For Ex:- Amitabh bacchan's fames inherited by his child Abhishek.

    Program Ex:-

    class A{
    print(){
    System.out.println("HELLLO ");
    }}

    class B extends class A{
    public static void main(String... args){
    A pr=new A();
    pr.print();
    }}

    Things to remember:---
    * Every class in java inherited by its parent class Object which is in the package:- java.lang.Object when the class is not extended by any child class only.
    * Java does not support "Multiple Inheritance" except in the case of Interface Concept.
    Because one class cannot extend more than one class but Interface able to extend more than one.

    Please Login First :
    Tags:

    Tech Mahindra iGate Syntel Inc. Accenture AT&T 

  • 2. What is the Set interface ?
  • Answer:

    A set is a collection that cannot contain duplicate elements. Set has it's implementation in various classes like HastSet, TreeSet, LinkedHashSet. Set has only methods that are inherited from Collection and adds the restrictions to prohibit duplicate elements.

    Please Login First :
    Tags:

    Tech Mahindra 

  • 3. What are the OOPS concepts? and What are the use of OOPs concept?
  • Answer:

    1) Encapsulation: It is the mechanism that binds together code and data in manipulates, and keeps both safe from outside interference and misuse. In short it isolates a particular code and data from all other codes and data. A well-defined interface controls the access to that particular code and data.
    2) Inheritance: It is the process by which one object acquires the properties of another object. This supports the hierarchical classification. Without the use of hierarchies, each object would need to define all its characteristics explicitly. However, by use of inheritance, an object need only define those qualities that make it unique within its class. It can inherit its general attributes from its parent. A new sub-class inherits all of the attributes of all of its ancestors.
    3) Polymorphism: It is a feature that allows one interface to be used for general class of actions. The specific action is determined by the exact nature of the situation. In general polymorphism means "one interface, multiple methods"; this means that it is possible to design a generic interface to a group of related activities. This helps reduce complexity by allowing the same interface to be used to specify a general class of action. It is the compiler's job to select the specific action (that is, method) as it applies to each situation.

    Please Login First :
    Tags:

    Wipro Aricent Tech Mahindra Virtusa Syntel Inc. 

  • 4. What is encapsulation?
  • Answer:

    Encapsulation is binding of attributes and behaviors. Hiding the actual implementation and exposing the functionality of any object. Encapsulation is the first step towards OOPS, is the procedure of covering up of data and functions into a single unit (called class). Its main aim is to protect the data from out side world.

    Please Login First :
    Tags:

    Wipro Tech Mahindra TCS iGate Accenture 

  • 5. Define function overloading.
  • Answer:

    Two or more functions can share the same name that perform a variety of different tasks as long as their parameter declarations are different. The functions that share the same name are said to be overloaded, and the process is referred to as function overloading.

    Please Login First :
    Tags:

    Tech Mahindra TCS 

  • 6. What do you mean by overriding?
  • Answer:

    No Discussion on this question yet!

    Please Login First :
    Tags:

    Wipro Aricent Tech Mahindra Syntel Inc. 

  • 7. Tell me the difference b/w whatsapp and facebook.[economy wise].
  • Answer:

    No Discussion on this question yet!

    Please Login First :
    Tags:

    Tech Mahindra 

  • 8. What is your favorite subject?
  • Answer:

    No Discussion on this question yet!

    Please Login First :
    Tags:

    Tech Mahindra Accenture 

  • 9. Tell me something about your projects?
  • Answer:

    No Discussion on this question yet!

    Please Login First :
    Tags:

    Tech Mahindra iGate Virtusa 

  • 10. What is your role in the project?
  • Answer:

    No Discussion on this question yet!

    Please Login First :
    Tags:

    Tech Mahindra iGate Virtusa Syntel Inc. Accenture