Technical Interview Questions and Answers :: Accenture
- Select All
- C
- Java
- C++
- .NET
- SQL
- Informatica
- WebMethod
- Soft. Engineering
- Data Structure
- HR Question in TR
- Operating System
- DBMS
81 / 152
No Discussion on this question yet!
82 / 152
Abstraction is of the process of hiding unwanted details from the user.
83 / 152
Encapsulation is binding of attributes and behaviors. Hiding the actual implementation and exposing the functionality of any object. Encapsulation is the first step towards OOPS, is the procedure of covering up of data and functions into a single unit (called class). Its main aim is to protect the data from out side world.
84 / 152
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 lifetime, the attributes of the object may undergo significant change.
85 / 152
Single entity showing multiple behaviours.
Example: Mobile can be used to take photos , internet usage,text documents creation etc.,
Two types of polymorphism 1.static polymorphism ( method over riding)
2. Dynamic polymorphism ( method over loading)
86 / 152
No Discussion on this question yet!
87 / 152
A scope resolution operator (::), can be used to define the member functions of a class outside the class.
88 / 152
A virtual function allows derived classes to replace the implementation provided by the base class. The compiler makes sure the replacement is always called whenever the object in question is actually of the derived class, even if the object is accessed by a base pointer rather than a derived pointer. This allows algorithms in the base class to be replaced in the derived class, even if users don't know about the derived class.
89 / 152
As the name suggests, the function acts as a friend to a class. As a friend of a class, it can access its private and protected members. A friend function is not a member of the class. But it must be listed in the class definition.
90 / 152
Structure: Initially (in C) a structure was used to bundle different type of data types together to perform a particular functionality. But C++ extended the structure to contain functions also. The major difference is that all declarations inside a structure are by default public.
Class: Class is a successor of Structure. By default all the members inside the class are private.