What is public , private , protected ?

No comments

Public  :-  It is  an  access  specifier  that  uses  to  access  the  only  members  of  its  own  class.  It  is  used  to  hide  data  inside  a  class,  so  that  it  is  not  accessed  mistakenly  by  any  function  outside  the  class.

private  :-  The  public  access  specifier  is  used  to  access  the  object  of  the  class  in  addition  to  their  own  class  member  as  well  as  accessed  from  outside  the  class.

protected  :-  This  access  specifier  is  used  to  access  the  members  of  inherited  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 🎀