1.what are two type of classe members called?
2.what is data hiding and data encapsulation?
3.how do you make a class member visible aouside its class?
4.what is the default visibility of a class data member?
5.what are the advantages of oop over the structured
programing?

Answer Posted / lilly

1. data members and member functions.
2.data hiding is where data is hidden from outside access
other than class members.
data encapsulation is where data members and member
functions are binded together into a single entity called
class which inturn does data hiding.
3.by changing the visibility mode as public.
4.the visibility of a class data member will be private by
default.
5.a.data is controlling access over the code in oop whereas
in structured programming code is acting on data.
b.data is hidden from outside access by encapsulating it
into a single entity whereas no data security in SP.
c.emphasis is on data in oop whereas in SP emphasis is on
functions.
d.Objects play the main role in oop where as no objects in
SP.
e.Code can be reused in oop by inheritance feature whereas
in Sp we cant reuse the code.
f.large n complex programs can be easily maintained whereas
in SP it becomes complex when it reaches 100,000 lines of
code.
g.we can use global and local variables easily in oop coz
of class entity but it is very complex and confusing in
Structured programming.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the point of oop?

656


Explain the advantages of inheritance.

675


What is purpose of inheritance?

645


What is the example of polymorphism?

560


How to use CMutex, CSemaphore in VC++ MFC

4333






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.

1459


What is debug class?what is trace class? What differences are between them? With examples.

1610


what is different between oops and c++

2004


class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash

1698


Why do we use inheritance?

630


#include #include #include #include void insert(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); insert(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void insert(char *items, int count) { register int a, b; char t; for(a=1; a < count; ++a) { t = items[a]; for(b=a-1; (b >= 0) && (t < items[b]); b--) items[b+1] = items[b]; items[b+1] = t; } } design an algorithm for Insertion Sort

2169


Which type does string inherit from?

616


what is the drawback of classical methods in oops?

2920


Why it is called runtime polymorphism?

577


Is oop better than procedural?

574