Important Question On C Language Asked in Interview or Viva
Well following are the commonly asked interview question which you may have to face in your interview or Campus interview Selection rounds ....
1.Define friend function.
A: A friend function is a non-member function of a class which has access to the private members of that class.
2.How is they declared and defined?
A: A friend function is declared in a class using the keyword friend. It is defined outside the class like any other normal functions.
3.How is a friend function invoked?
A: A friend function is invoked like a normal function in C++.
4.What are reference variables and what is their use?
A: A reference variable acts as alias to the another variable.
5.What are the features of OOP?
A: 1:Class,2.Object,3.Data abstraction and encapsulation,4.Polymorphism,5.Dynamic binding,6.Message passing.
6.What is dynamic binding?
A: The linkage between a procedure call and the code to be executed is known at run time is called dynamic binding. It’s related to polymorphism.
7.Define polymorphism.
8.What are two types of polymorphisms? Give example for both.
A: Compile time polymorphism and run-time polymorphism,eg: function overloading and virtual functions respectively.
9.What is a do nothing function?
A: A function declared in a base class and does not do any operations and is redefined in sub classes is called a do nothing function.
10.Define pointers.
A: Pointers are used to store address of memory locations.
Best of Luck Friends.... :)
No comments:
Post a Comment