What are advantages of using Innerclasses

Questions by kranthi kumar   answers by kranthi kumar

Showing Answers 1 - 1 of 1 Answers

Karthik

  • Apr 24th, 2006
 

First,The main purpose of inner class as the name implies.,ie., not to have as a seperate class.

There may be situations where you need a helper sort of class which is very specific for a single class.In that case it may not be very good to have a seperate-independent class and give it a big figure. Instead embedd the class within the class that requires the innerclass' functionality.

The main advantage is the inner class can share a intimate relationship with the outer class.(it can access its private variables)

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions