- 1
How many types of modifiers in java? list them all modifiers also..
8 Respostas
+ 4
There are total 12 types of modifiers in java.
These are following...
public
private
protected
<default >
final
abstract
static
synchronized
strictfp
transient
native
volatile
+ 11
Do you mean the access modifiers?
public
protected
private
no modifier (so called package private)
0
Access Control Modifiers
Java provides a number of access modifiers to set access levels for classes, variables, methods and constructors. The four access levels are −
Visible to the package, the default. No modifiers are needed.
Visible to the class only (private).
Visible to the world (public).
Visible to the package and all subclasses (protected).
Non-Access Modifiers
Java provides a number of non-access modifiers to achieve many other functionality.
The static modifier for creating class methods and variables.
The final modifier for finalizing the implementations of classes, methods, and variables.
The abstract modifier for creating abstract classes and methods.
The synchronized and volatile modifiers, which are used for threads.
See more here:- http://crbtech.in/Java-Training/explain-the-access-and-non-access-modifiers-in-java/
0
There are 4 different access modifiers available in java language. They are public, protected, private and no modifier (declaring without an access modifier). Using ‘no modifier’ is also sometimes referred as ‘package-private’ or ‘default’ or ‘friendly’ access.
private - accessible to the classes only.
protected - accessible to class, package, and subclasses
[default] - accessible to the class and package
public - accessible to global
More: http://net-informations.com/java/basics/modifiers.htm
0
public,private,hidden,protected
0
public
protected
privet
0
public
protected
private