Like This Site? 
 
RSS Feed Follow Us 

on Twitter! Be Our Fan!

Java Access Specifiers : Complete Tutorial

Share this post!
 Vote this!

One of the prime features of object oriented programming is data encapsulation.This feature enables data to have restricted access.There are currently four different access specifiers in JAVA. Namely,

  1. Public
  2. Protected
  3. Default
  4. Private

Public:- All the data members and member functions which are declared public can be accessed from anywhere outside or inside the class which means it can be accessed by any object or through any member functions.It is also called a class level access modifier as class is usually made public in JAVA so that it can be accessed from anywhere.  more...

0 comments:

Post a Comment