Lecture 5 - Slide 12 : 40 |
Classes can be nested in C++
Similar to inner static classes in Java
No consequences for the nesting of instances of the involved classes
![]() | Class Outer that contains class Inner - does not compile. |
![]() | Class Outer that contains class Inner - friends of each other. |
![]() | Inner attempts to access to non-static variable in Outer - does not compile. |
![]() | Problems solved - This program compiles. |
![]() | Study the examples of nested classes |