C++ Interview Questions and Answers for Freshers - 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.
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.
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.
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.
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
7000+ Computer Networking MCQ Questions and Answers Pdf More
7000+ Microsoft Office Practical Questions and Answers Pdf More
7000+ Microsoft Office MCQ Questions and Answers Pdf More
7000+ Microsoft Office Quiz Questions and Answers Pdf More
7000+ Cyber Security Quiz Questions and Answers Pdf More
1000+ GATE Previous Year Solved Question Papers Pdf More
Indian Constitution Objective Questions for Competitive Exams More
1000+ System Analysis and Design MCQ Questions and Answers More
150+ Data Structure Interview Questions and Answers in C# More
100+ Verbal Ability One Word Substitution Questions & Answers More