0

Can anyone give me an example when an inner class is used. I started with wrapper class and found inner class is used in that but as i am all new to this i was thinking if anyone can give me an simpler example for inner class use so I understand why its used and why it helps in situations .

Thanks

3
  • Class can describe objects. en.wikipedia.org/wiki/Object-oriented_programming. And sometimes, if classes are really small, it make zero sense to create a separate file for it (f.e wrapper classes/ deserialization types)
    – kurunve
    Jun 8, 2017 at 11:26
  • @kurunve I'd disagree with the Wrapper Class example. If you write a lot of code that requires the use of, say, a ContactWrapper. It'd eventually make more sense to put that into it's own class rather constantly "rewriting the wheel".
    – Dan Jones
    Jun 8, 2017 at 11:35
  • @DanJones your opinion makes some sense. I pointed that in "if classes are really small".
    – kurunve
    Jun 8, 2017 at 11:49

0

Browse other questions tagged .