Define nested class? why can it be useful?, C/C++ Programming

it is a class enclosed in the scope of another class. For illustration:

// Example: Nested class

//

class OuterClass

{

class NestedClass

{

// ...

};

// ...

};

Nested classes are helpful for organizing code and controlling dependencies and access. Nested classes obey access rules as other parts of class do; thus, in Example, if Nested Class is public then any code may name it as OuterClass::NestedClass. Frequently nested classes have private implementation details, and are thus made private; in Example, if NestedClass is private, then just OuterClass's members and friends can employ NestedClass. While you instantiate like outer class, it won't instantiate inside class.

 

Posted Date: 3/16/2013 3:02:04 AM | Location : United States







Related Discussions:- Define nested class? why can it be useful?, Assignment Help, Ask Question on Define nested class? why can it be useful?, Get Answer, Expert's Help, Define nested class? why can it be useful? Discussions

Write discussion on Define nested class? why can it be useful?
Your posts are moderated
Related Questions
Define Scope Rules of C program - Computer Programming? The fundamental rule of scope is that identifiers are accessible only within the block in which they are declared and th

A: It allows a program to reference an identifier in global scope which has been hidden by another identifier along with the same name in the local scope.

In the Byteland country a string "s" is said to super ascii string if and only if count of each charecter in the string is equal to its ascci value in the byteland country ascii co

A: They are following: Const: point out that memory once initialized, must not be modify through a program. Volatile: denote that value in the memory location can be modified


what is an array?

Incomplete types refer to pointers in which there is no availability of the execution of the referenced location or it points to some location whose value is not available for modi

Pawnbroker software to be written in VB Project Description: I want software written for my pawnshop. I am currently using a program called pawnboss but would like to have my

Two kinds of line detection are implemented in OpenCV, the Hough Transform and the probabilistic Hough transform. Assume that there are n feature points in an image and that it tak

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b