OOPS - CORRECT ANSWER Object Oriented Programming System.
Class - CORRECT ANSWER Class is a blue print which reflects the entities attributes and
... [Show More] actions. Technically defining a class is designing an user defined data type.
Object - CORRECT ANSWER An instance of the class is called as object.
List the types of inheritance supported in C++ - CORRECT ANSWER Single, Multilevel, Multiple, Hierarchical and Hybrid.
What is the role of protected access specifier? - CORRECT ANSWER If a class member is protected then it is accessible in the inherited class. However, outside the both the private and protected members are not accessible.
What is encapsulation? - CORRECT ANSWER The process of binding the data and the functions acting on the data together in an entity (class) called as encapsulation.
What is abstraction? - CORRECT ANSWER Abstraction refers to hiding the internal implementation and exhibiting only the necessary details.
What is inheritance? - CORRECT ANSWER Inheritance is the process of acquiring the properties of the exiting class into the new class. The existing class is called as base/parent class and the inherited class is called as derived/child class.
Explain the purpose of the keyword volatile - CORRECT ANSWER Declaring a variable volatile directs the compiler that the variable can be changed externally. Hence avoiding compiler optimization on the variable reference.
What is an inline function? - CORRECT ANSWER A function prefixed with the keyword inline before the function definition is called as inline function. The inline functions are faster in execution when compared to normal functions as the compiler treats inline functions as macros.
What is a storage class? - CORRECT ANSWER Storage class specifies the life or scope of symbols such as variable or functions.
Mention the storage classes names in C++. - CORRECT ANSWER auto, register, extern, static, mutable
What is the role of mutable storage class specifier? - CORRECT ANSWER A constant class object's member variable can be altered by declaring it using mutable storage class specifier. Applicable only for non-static and non-constant member variable of the class.
Distinguish between shallow copy and deep copy. - CORRECT ANSWER Shallow copy does memory dumping bit-by-bit from one object to another. Deep copy is copy field by field from object to another. Deep copy is achieved using copy constructor and or overloading assignment operator.
What is a pure virtual function? - CORRECT ANSWER A virtual function with no function body and assigned with a value zero is called as pure virtual function.
What is an abstract class in C++? - CORRECT ANSWER A class with at least one pure virtual function is called as abstract class. We cannot instantiate an abstract class.
What is a reference variable in C++? - CORRECT ANSWER A reference variable is an alias name for the existing variable. Which mean both the variable name and reference variable point to the same memory location. Therefore update on the original variable can be achieved using reference variable too.
What is role of static keyword on class member variable? - CORRECT ANSWER A static variable does exit though the objects for the respective class are not created. Static member variable share a common memory across all the objects created for the respective class. A static member variable can be referred using the class name itself.
Explain the static member function. - CORRECT ANSWER A static member function can be invoked using the class name as it exist before class objects comes into existence. It can access only static members of the class.
Name the data type which can be used to store wide characters in C++. - CORRECT ANSWER wchar_t
What are/is the operator/operators used to access the class members? - CORRECT ANSWER Dot (.) and Arrow ( -> )
Can we initialize a class/structure member variable as soon as the same is defined? - CORRECT ANSWER No, Defining a class/structure is just a type definition and will not allocated memory for the same.
What is the data type to store the Boolean value? - CORRECT ANSWER bool, is the new primitive data type introduced in C++ language.
What is function overloading? - CORRECT ANSWER Defining several functions with the same name with unique list of parameters is called as function overloading.
What is operator overloading? - CORRECT ANSWER Defining a new job for the existing operator w.r.t the class objects is called as operator overloading.
Do we have a String primitive data type in C++? - CORRECT ANSWER No, it's a class from STL (Standard template library).
Name the default standard streams in C++. - CORRECT ANSWER cin, cout, cerr and clog.
Which access specifier/s can help to achive data hiding in C++? - CORRECT ANSWER Private & Protected.
When a class member is defined outside the class, which operator can be used to associate the function definition to a particular class? - CORRECT ANSWER Scope resolution operator (::)
What is a destructor? Can it be overloaded? - CORRECT ANSWER A destructor is the member function of the class which is having the same name as the class name and prefixed with tilde (~) symbol. It gets executed automatically w.r.t the object as soon as the object loses its scope. It cannot be overloaded and the only form is without the parameters.
What is a constructor? - CORRECT ANSWER A constructor is the member function of the class which is having the same as the class name and gets executed automatically as soon as the object for the respective class is created.
What is a default constructor? Can we provide one for our class? - CORRECT ANSWER Every class does have a constructor provided by the compiler if the programmer doesn't provides one and known as default constructor. A programmer provided constructor with no parameters is called as default constructor. In such case compiler doesn't provides the constructor.
Which operator can be used in C++ to allocate [Show Less]