Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Difference between Access Specifier and Modifier in Java

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 19-01-2010
Member
 
Join Date: Dec 2009
Posts: 41
Difference between Access Specifier and Modifier in Java
  

Hi Friend,

I am IT student with lots of confusion about the java concept. I am little bit aware about the access modifier of the java programming language. But I don't what is the exact difference between Access Specifier and Modifier in Java. Is the Access Specifier is completely different than Access Modifier ? or what. Please let me know some difference among Access Specifier and Modifier of Java. I awaiting for your reply.

Reply With Quote
  #2  
Old 19-01-2010
Member
 
Join Date: Apr 2008
Posts: 1,944
Re: Difference between Access Specifier and Modifier in Java

Hi,

There are basically three type of access specifier are available in java and which are private, protected and public. These access specifiers are placed in front of each definition for each member in your class, whether it’s a data member or a method. Each Java access specifier controls the access for only that particular definition. This is a distinct contrast to C++, in which the access specifier controls all the definitions following it until another access specifier comes along.
Reply With Quote
  #3  
Old 19-01-2010
Member
 
Join Date: Apr 2008
Posts: 1,993
Re: Difference between Access Specifier and Modifier in Java

Hello friend,

Access modifiers in Java specifies access to the java code. Java Access modifiers divided into four categories and which are protected, public, private, no modifier. Using ‘no modifier’ is sometimes also referred as ‘package-private’ or ‘friendly’ or ‘default’ access. The two levels are class level access modifier and member level access modifier. In public or in no modifier maximum two access modifiers are allowed.
Reply With Quote
  #4  
Old 19-01-2010
Member
 
Join Date: May 2008
Posts: 2,283
Re: Difference between Access Specifier and Modifier in Java

Access Modifiers:
The Access Modifiers of Java is basically essential to declare field. Using this access modifiers you can apply access modifier to variable, methods or class. The java classes can have Abstract modifier. This Abstract modifier sud divided into synchronized, native and abstract. The access modifiers categorized into protected, private, no modifier and public.
Reply With Quote
  #5  
Old 19-01-2010
Member
 
Join Date: Oct 2005
Posts: 2,385
Re: Difference between Access Specifier and Modifier in Java

Java Access Specifier is works as super class of the non-Access Modifier and Access Modifier to specifies accessibility to java code.
Java Access Modifier comprises four categories:
  • Default
  • Protected
  • Public
  • Private
Java Access Specifier comprises three categories:
  • Private
  • Public
  • Protected
Reply With Quote
  #6  
Old 19-01-2010
Member
 
Join Date: May 2008
Posts: 2,373
Re: Difference between Access Specifier and Modifier in Java

Hi friend,

Java Access modifiers divided into to two main types which are as below:

Class level access modifiers:
This access modifiers is only allowed no modifier and public. If the java class 'no modifer' then it has access only to variables within same package. If the java class 'public' modifier then it has access to all variables of class.

Member level access modifiers :
This access modifiers is only allowed private, protected and public. If the java class 'public' modifier then it has access to all variables of in same class.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Difference between Access Specifier and Modifier in Java"
Thread Thread Starter Forum Replies Last Post
Difference between Java Class and Bean Bottlenecked Software Development 5 01-02-2010 12:28 PM
What is the difference between Iterator and Enumeration in Java? Karsenman Software Development 4 28-01-2010 08:56 AM
what is the difference between c and java? Linoo Software Development 5 28-11-2009 04:11 PM
What is the difference between CORBA and Java RMI? Triple-X Software Development 3 03-09-2009 05:59 PM
What is the difference between an object and an instance in java? Lalit5 Software Development 5 02-03-2009 08:00 PM


All times are GMT +5.5. The time now is 09:15 AM.