Sorry ganesh! I didn't see the other post with caution. It is indeed different.
You have to use an outer class instance to create an instance of the inner class. Every non-static method has a instance of the associated class which can be accessed using the this keyword. Since the class B is inside the class A, and this in method m2 refers to an instance of class A, so you can use the this to create an instance of class B. Let me change the code a bit
Now it would be clearer to you. Also the method m3 also uses this to create an instance of the inner class. The method m3 is equivalent to this code