Can someone plz explain in what cases do we want to use inner classes? | SoloLearn: Learn to code for FREE!

0

Can someone plz explain in what cases do we want to use inner classes?

8/10/2016 2:13:10 PM

Shazamit Shazam

2 Answers

New Answer

+5

This example can help you understand the need of an Inner class. Class Bank { int name; int unique_bank_id; private Class AccountDetails { int confidential_info; int amount; } } The class Bank has an inner class AccountDetails. The inner class can access all the members of its outer class but it cannot be accessed from any outside class.

+1

this inner class is very use full for making cms desktop apps