What is nested class ?

No comments


Classes  can  be  define  inside  other  classes.  Classes  that  are  inside  other  classes  are  called  nested  class.

A  classes can  be  nested  in  every  part  of  the  surrounding  classes  in  the  public,  protected  and  private  section.  Such  a  nested  class  can  be  considered  a  member  of  the  surrounding  class.  The  normal   access  and  visibility  rules  in  classes  apply  to  the  nested  class.

In public  section  :  It is  visible  outside  in  surrounding  class.

In protected  section  :  It  is  visible  in  sub –  classes  derived  in  the  surrounding  class.

In private  section  :  It  is  only  visible  for  the  member  of  the  surrounding  class.

No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀