What are different type of access modifiers?

Answer Posted / chandra rekha

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we override the static methods?

576


What is application tier?

534


What is the vector class in java programming?

569


Differentiate between vector and array list.

638


What is bool mean?

575






What is getclass () getname () in java?

683


Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?

565


What is the driver class?

569


why would you use a synchronized block vs. Synchronized method? : Java thread

537


How thread scheduler schedule the task?

587


Why are arrays useful in java?

544


How to display all the prime numbers between 1 and 100

509


What is default locale java?

541


What is the default access specifier for variables and methods of a class?

570


4.1 Supply contracts (in the form of comments specifying pre- and post conditions) for the enqueue() method of the LinkedQueue class given in the Appendix. (2) 4.2 Let Thing be a class which is capable of cloning objects, and consider the code fragment: Thing thing1 = new Thing(); //(1) Thing thing2 = thing1; //(2) Thing thing3 = (Thing) thing1.clone(); //(3) Explain how the objects thing2 and thing3 differ from each other after execution of the statements. (

1418