Flavors of Nested Classes in Java 8

In this post, we’ll explore varieties nested classes such as static nested classes, inner classes, local inner classes and Anonymous inner class with their pros and cons with examples.

Classes defined within the body of another class (or interface) are known as nested classes. Normally you define a class, which is a top-level class directly belonging to a package. In contrast, nested classes are classes contained within another class or interface.

Click here to read more




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s