The purpose of private, protected is to hide the data and methods from outside class. Means the other classes(except C1) can not access private data which are created in one class(C1). This feature of OOP is called data hiding or abstraction RegardsDeepak
--- On Thu, 10/3/11, deepak murali <[email protected]> wrote: From: deepak murali <[email protected]> Subject: [java programming] hai To: "Java Programming Online Training Course By Sang Shin" <[email protected]> Date: Thursday, 10 March, 2011, 11:22 AM in object oriented programming language like c++, we use access specifiers like public,private and protected, i know how to use them,but dont know what is main advantage of using them. are those access specifiers used to protect files, hide passwords etc or they serve for different purpose -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en
