What are different type of access modifiers?
Answers were Sorted based on User's Feedback
Answer / janet
Public: Any thing declared as public can be accessed from
any where.
Private: Any thing declared as private can't be seen
outside of it's class.
Protected: Any thing declared as protected can be accessed
by classes in the same package and subclasses in the other
packages.
Default modifier: can be accessed only to classes in the
same package.
| Is This Answer Correct ? | 11 Yes | 4 No |
Answer / ravikiran
static
final
native
abstract
synchronized
strictfp
transient
volatile
| Is This Answer Correct ? | 6 Yes | 2 No |
Access modifiers is different from Access specifiers. The
access specifiers tells whether member data\methods\classes
of a class can be accesible or not by other
classes\subclasses\packages whereas the modifiers tells how
the memberdata\methods\classes can be used by other classes.
The access specifiers available in java are
Public,private,protected,default(friend or package).
The modifiers available are
static:can be applied to member data,methods,inner
classes.used to define class variables and methods that
belong to the a class but not to any particular instance of
class.all the variables share the same static method.
final:(variables,methods,classes) final modifier indicates
that the variable\method\class cannot be modified in any
other classes\subclasses\packages.
abstract:(classes) used to declare classes having same
properties and methods.abstract classes are used to derive
classes of the same type.
native:(methods) indicates that the code is out of java
runtime environment,written in some other programming
language other than java.
synchronized:(methods) used to control access to a
particular method in a multithreaded java program.
| Is This Answer Correct ? | 4 Yes | 3 No |
How does sublist works in java?
What is Java Annotations?
does java support pointers?
what is the role of xml in core java?? and how we can use it?? can somebody give a sample program with explanation and from where i can read more about xml?????
0 Answers HCL, SAP Labs, Vital Soft,
Explain an intermediate language?
Write a program to show whether a graph is a tree or not using adjacency matrix.
Does chrome use java?
class A{ class B{ } } in which name u save the file,its the program compile?
can we add two numbers without using arthematic operators? if possible how?
please tell me what is wrapper class in java with example ?
Life Cycle of Thread
which one is performance wise advantageious from List,Set,Map?