Ask Google

Custom Search

Thursday, February 17, 2011

Difference between private, protected, and public?

What is the difference between private, protected, and public?

These keywords are for allowing privilages to components such as functions and variables.

Public: accessible to
all classes
Private: accessible
only to the class to which they belong
Protected: accessible to the
class to which they belong and any subclasses.

1 comment:

  1. I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Java Training in Chennai | Core Java Training in Chennai

    Online Java Training Online Java Training | Java J2EE Online Training | JavaEE Training Institute in Chennai m

    ReplyDelete

5L15K

  © Blogger template The Beach by Ourblogtemplates.com 2009

Back to TOP