1#include<iostream>
2using namespace std;
3class A {
4 public:
5 class B {
6 private:
7 int num;
8 public:
9 void getdata(int n) {
10 num = n;
11 }
12 void putdata() {
13 cout<<"The number is "<<num;
14 }
15 };
16};
17int main() {
18 cout<<"Nested classes in C++"<< endl;
19 A :: B obj;
20 obj.getdata(9);
21 obj.putdata();
22 return 0;
23}