Friday, July 19, 2013

13. What are nested class in Java ?

A class within a class is called nested class.

Nested classes are divided into two categories: static and non-static. Nested classes that are declared static are simply called static nested classes. Non-static nested classes are called inner classes.

class myOutterClass{

static class my staticClass {
/* -- -- --
   -- -- --*/
}

class myInnerClass{
/* -- -- --
   -- -- --*/
}

}


More information on nested class in official link below
http://docs.oracle.com/javase/tutorial/java/javaOO/nested.html

No comments :

Post a Comment