C++ Interview Questions and Answers for Freshers - 1
Question: 1
What is Polymorphism?
Polymorphism means that some code or operations or objects behave differently in different contexts.
In C++, following features support polymorphism.
Compile Time Polymorphism: means compiler knows which function should be called when a polymorphic call is made. C++ supports compiler time polymorphism by supporting features like templates, function overloading and default arguments.
Run Time Polymorphism: is supported by virtual functions. The idea is virtual functions are called according to the type of object pointed or referred, not according to the type of pointer or reference. In other words, virtual functions are resolved late, at runtime.
Question: 2
What is encapsulation?
Encapsulation is referred to one of the following two notions.
Data hiding: A language feature to restrict access to members of an object. For example, private and protected members in C++
Bundling of data and methods together: Data and methods that operate on that data are bundled together.
Question: 3
What is a class?
Class is a user defined data type in C++.
It can be created to solve a particular kind of problem.
After creation the user need not know the specifies of the working of a class.
Question: 4
What is the difference between an object and a class?
Classes and objects are separate but related concepts. Every object belongs to a class and every class contains one or more related objects.
A Class is static. All of the attributes of a class are fixed before, during, and after the execution of a program. The attributes of a class don’t change.
The class to which an object belongs is also (usually) static. If a particular object belongs to a certain class at the time that it is created then it almost certainly will still belong to that class right up until the time that it is destroyed.
An object on the other hand has a limited lifespan. Objects are created and eventually destroyed. Also during that life lifetime, the attributes of the objects may undergo significant change.
Question: 5
What is abstraction?
Abstraction is of the process of hiding unwanted details from the user.
- C++ Interview Questions and Answers for Experienced
- Top 200+ C++ Interview Questions and Answers
- C++ Interview Questions and Answers for Freshers
- Advanced C++ Programming Interview Questions and Answers
- C++ Language Interview Questions for Experienced Pdf
- C++ Programs Asked in Interview for Freshers
- C++ Interview Questions and Answers Pdf
- C++ Language Interview Questions and Answers for Freshers Pdf
- C++ Questions and Answers
- Top 250+ C++ Constructor and Destructor Programming Interview Questions
- C++ basic interview questions and answers pdf
- C++ Programming Interview Questions and Answers
- C++ Technical Interview Questions and Answers
- Top 200+ Advanced C++ Interview Questions 2020-2021
- C++ Lab Viva-Practical Exams Questions and Answers
- C++ Coding Interview Questions and Answers
TNPSC Migration and Urbanisation Research Questions More
Migration and Urbanisation MCQ Questions and Answers Pdf More
Migration and Urbanisation Class 8 Questions and Answers Pdf More
People's Revolt Class 8 Questions and Answers Pdf More
Trade and Territory Class 8 Questions and Answers Pdf More
Top 1,000+ Computer Programming Quiz More
SSC CGL, CHSL, MTS Synonyms and Antonyms Pdf More
Wrong Number Series Quiz Questions for Bank Exams Pdf More
1000+ TNPSC Group 8 Exam Question Papers with Answers Pdf More
1000+ Asp.Net Quiz Questions and Answers More