1. What do you mean by early binding?
Ans: Early binding refers to the events that occur at compile time. Early binding occurs when all information needed to call a function is known at compile time. Examples of early binding include normal function calls, overloaded function calls, and overloaded operators. The advantage of early binding is efficiency.
2. What is a constructor?
Ans: Constructor is a special member function of a class, which is invoked automatically whenever an instance of the class is created. It has the same name as its class.
3. What is a container class? What are the types of container classes?
Ans: A container class is a class that is used to hold objects in memory or external storage. A container class acts as a generic holder. A container class has a predefined behavior and a well-known interface. A container class is a supporting class whose purpose is to hide the topology used for maintaining the list of objects in memory. When a container class contains a group of mixed objects, the container is called a heterogeneous container; when the container is holding a group of objects that are all the same, the container is called a homogeneous container
Ans: Early binding refers to the events that occur at compile time. Early binding occurs when all information needed to call a function is known at compile time. Examples of early binding include normal function calls, overloaded function calls, and overloaded operators. The advantage of early binding is efficiency.
2. What is a constructor?
Ans: Constructor is a special member function of a class, which is invoked automatically whenever an instance of the class is created. It has the same name as its class.
3. What is a container class? What are the types of container classes?
Ans: A container class is a class that is used to hold objects in memory or external storage. A container class acts as a generic holder. A container class has a predefined behavior and a well-known interface. A container class is a supporting class whose purpose is to hide the topology used for maintaining the list of objects in memory. When a container class contains a group of mixed objects, the container is called a heterogeneous container; when the container is holding a group of objects that are all the same, the container is called a homogeneous container
Advertisement
4. What is an adaptor class or Wrapper class?
Ans: A class that has no functionality of its own. Its member functions hide the use of a third party software component or an object with the non-compatible interface or a non-object-oriented implementation.
5. Differentiate between a template class and class template?
Ans:
Template class:
A generic definition or a parameterized class not instantiated until the client provides the needed information. It’s jargon for plain templates.
Class template:
A class template specifies how individual classes can be constructed much like the way a class specifies how individual objects can be constructed. It’s jargon for plain classes.
6. What do you mean by reference variable in c++?
Ans: A reference variable provides an alias to a previously defined variable.
Data type & reference-name = variable name
Ans: A class that has no functionality of its own. Its member functions hide the use of a third party software component or an object with the non-compatible interface or a non-object-oriented implementation.
5. Differentiate between a template class and class template?
Ans:
Template class:
A generic definition or a parameterized class not instantiated until the client provides the needed information. It’s jargon for plain templates.
Class template:
A class template specifies how individual classes can be constructed much like the way a class specifies how individual objects can be constructed. It’s jargon for plain classes.
6. What do you mean by reference variable in c++?
Ans: A reference variable provides an alias to a previously defined variable.
Data type & reference-name = variable name
Advertisement
7. What do you mean by static methods?
Ans: By using the static method there is no need creating an object of that class to use that method. We can directly call that method on that class. For example, say class A has static function f(), then we can call f() function as A.f(). There is no need of creating an object of class A.
8. What is a class?
Ans: The objects with the same data structure (attributes) and behavior (operations) are called class.
9. What is an object?
Ans: It is an entity which may correspond to real-world entities such as students, employees, bank account. It may be concrete such as file system or conceptual such as scheduling policies in multiprocessor operating system. Every object will have data structures called attributes and behavior called operations.
10. What is the difference between an object and a class?
Ans: All objects possessing similar properties are grouped into class.
Example :–person is a class, ram, hari are objects of person class. All have similar attributes like name, age, sex and similar operations like speak, walk.
Class person
{
private:
char name[20];
int age;
char sex;
public: speak();
walk();
};
Ans: By using the static method there is no need creating an object of that class to use that method. We can directly call that method on that class. For example, say class A has static function f(), then we can call f() function as A.f(). There is no need of creating an object of class A.
8. What is a class?
Ans: The objects with the same data structure (attributes) and behavior (operations) are called class.
9. What is an object?
Ans: It is an entity which may correspond to real-world entities such as students, employees, bank account. It may be concrete such as file system or conceptual such as scheduling policies in multiprocessor operating system. Every object will have data structures called attributes and behavior called operations.
10. What is the difference between an object and a class?
Ans: All objects possessing similar properties are grouped into class.
Example :–person is a class, ram, hari are objects of person class. All have similar attributes like name, age, sex and similar operations like speak, walk.
Class person
{
private:
char name[20];
int age;
char sex;
public: speak();
walk();
};