Organizational Research By

Surprising Reserch Topic

What are inner classes and what is the practical implementation of inner classes?


Inner classes are nested inside other class. They have access to outer class fields and methods even if the fields of outer class are defined as private.
public class Pcds
{
class pcdsEmp
{
// inner class defines the required structure
String first;
String last;
}
// array of name objects
clsName personArray[] = {new clsName(), new clsName(), new clsName()};
}
Normally inner classes are used for data structures like one shown above or some kind of helper classes.
 
asked Sep 13, 2013 in oops by rajesh
edited Sep 12, 2013
0 votes
20 views



Related Hot Questions



Government Jobs Opening


...