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
Ask question #Minimum 100 words acceptedEducational Objectives: After completing this assignment, the student should be able to accomplish the following: Apply generic algorithms i

Introduction to C++ C++ was developed by Bjarne Stroustrup at Bell Laboratories in 1983. Originally, it was known as " C with class". C+ as an enhancement to the C language was

Introduction to Classes Object-oriented programming (OOP) is a conceptual approach to design programs. It can be executed in many languages, whether they directly support OOP c

MAT LAB programming Project Description: Just for who are PROFESSIONAL IN MATLAB i have simulation and i would like to simulate the equation in ,and test the all simulatio

A: A smart pointer is a C++ class which mimics a regular pointer in syntax and some semantics, however it does more. Since smart pointers to distinct types of objects tend to have

Write a program called Converter that does three types of metric conversions. Your program should prompt the user for the selection conversion, prompt for input data, and display t

F u nction overloading: Functions can be defined with same name.  Depending upon the type of argument passed the function will perform.  This is known function overloading

c program for padovan string   Padovan series are positive integers obtained by the following process: The Padovan series is the sequence of integers P(n) defined by the

how to make program c++

in this problem u given a board in which some of the elements are placed as shown in diagram below .each element represent a color .fill the other elements in the board such that n