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.
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.
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.
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.
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:
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.