javablogspot

Just another WordPress.com weblog

JAVA Class Access Specifiers

Posted by damuchinni on March 7, 2009

JAVA Class Access Specifiers

Access means visibility. In Java we can use two access specifiers (public,default) for class.

Default Access

If you are not specified any access specifier that will be considered as default access. Default access is a package level access. A class with default access can be seen by other classes in the same package.

Public Access

If a class specified as public, then all classes in the java universe can access that class. The classes in the same package can use the public class with out import, but the classes declare in other packages must need to import prior to accessing.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: