What is encapsulation?
Answers were Sorted based on User's Feedback
Answer / k.rakesh
Encapsulation means binding the data and coding the part is called as "Encapsulation"
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / laxmikanth k
Binding the data and code is called"encapsulation"
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / rahul
Encapsulation can be described as a protective barrier
that prevents the code and data being randomly accessed by
other code defined outside the class.
Encapsulation is the technique of making the fields in a
class private and providing access to the fields via public
methods. If a field is declared private, it cannot be
accessed by anyone outside the class, thereby hiding the
fields within the class. For this reason, encapsulation is
also referred to as data hiding.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / chinni
The wrapping up of data and functions into a single unit
called encapsulation.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / rajdeep gupta
Two concepts that go together in the object oriented approach are Encapsulation & Abstraction. Abstraction is the representation of only the essential features of an object, while Encapsulation is the hiding of the non-essential features.
Think of a person driving a car. He does not need to know the internal working of the engine or the way gear changes work, to be able to drive the car (Encapsulation). Instead, he needs to know things such as how much turning the steering wheel needs, etc (Abstraction).
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / kirti
Encapsulation is the ability to hide the internal workings of an object's behavior and its data. For instance, let's say you have a object named Bike and this object has a method named start(). When you create an instance of a Bike object and call its start() method you are not worried about what happens to accomplish this, you just want to make sure the state of the bike is changed to 'running' afterwards. This kind of behavior hiding is encapsulation and it makes programming much easier.
| Is This Answer Correct ? | 0 Yes | 0 No |
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?
#include <iostream> using namespace std; struct wow { int x; }; int main() { wow a; a.x = 22; int c = a.x; int *b = new int; cout << c; return 0; } option: No output 0 22 -(11) Will not compile
Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.
Why do we use oops?
What is inheritance in oop?
Can static class have constructor?
What is overloading and its types?
What is operator overloading? Give Example
11 Answers CTS, IBM, TCS,
Can we override main method?
Name an advantage of array over linked list?
24 Answers GML, IBM, Software Solutions,
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.
What is virtual Function.