Can someone plz explain in what cases do we want to use inner classes? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

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

10th Aug 2016, 2:13 PM
Shazamit Shazam
Shazamit Shazam - avatar
2 Answers
+ 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.
10th Aug 2016, 8:14 PM
Prasoon Verma
Prasoon Verma - avatar
+ 1
this inner class is very use full for making cms desktop apps
8th Sep 2016, 11:25 AM
Mohi
Mohi - avatar