View RSS Feed

Core Java

Fields, Methods, and Access Levels

Rate this Entry
by , 03-02-2012 at 04:13 PM (1267 Views)
  • Java classes consist of methods and fields. A field is same as a C++ data member & a method is similar to a C++ member function.
  • Each method & field possess an access level:

o private: access is possible in this class only
o (package): access is possible in this package only
o protected: access is possible in this package only & also in all subclasses.
o public: access is possible anywhere this class is present.
  • Every class consist of these 2 possible access levels:

o (package): class objects can be manipulated & declared only by the help of code present in this package
o public: class objects might be manipulated & declared by the help of code present in any package.

Submit "Fields, Methods, and Access Levels" to Facebook Submit "Fields, Methods, and Access Levels" to Digg Submit "Fields, Methods, and Access Levels" to del.icio.us Submit "Fields, Methods, and Access Levels" to StumbleUpon Submit "Fields, Methods, and Access Levels" to Google

Categories
Classes

Comments