adspace


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

Write a program to print count of empty strings in java 8?

1086


How to sort array in descending order in java?

996


Write a java program to find the route that connects between Red and Green Cells. General Rules for traversal 1. You can traverse from one cell to another vertically, horizontally or diagonally. 2. You cannot traverse through Black cells. 3. There should be only one Red and Green cell and at least one of each should be present. Otherwise the array is invalid. 4. You cannot revisit a cell that you have already traversed. 5. The maze need not be in the same as given in the above example

2665


What is an object in java and how is it created?

1140


What is the difference between equals() and == in java?

1040


Differentiate between static and non-static methods in java.

1128


Is minecraft 1.15 out?

1045


explain different ways of using thread? : Java thread

1082


What is parsing in java?

1041


Write a program to find the whether a number is an Armstrong number or not?

1098


What is a classloader in java?

1090


What are the differences between heap and stack memory in java?

1140


How to create a base64 decoder in java8?

1138


What is java string pool?

1083


What do you mean by an interface in java?

1105