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

Is arraylist a class in java?

524


How many bits is a string in java?

568


Can we use catch statement for checked exceptions?

508


Is string a data type in java?

587


Is there any way to find whether software installed in the system is registered by just providing the .exe file? I have tried the following code but its just displaying the directory structure in the registry. Here the code : package com.msi.intaller; import java.util.Iterator; import ca.beq.util.win32.registry.RegistryKey; import ca.beq.util.win32.registry.RootKey; public class RegistryFinder { public static void main(String... args) throws Exception { RegistryKey.initialize(RegistryFinder.class.getResource("jRe gistryKey.dll").getFile()); RegistryKey key = new RegistryKey(RootKey.HKLM, "Software\\ODBC"); for (Iterator subkeys = key.subkeys(); subkeys.hasNext();) { RegistryKey subkey = subkeys.next(); System.out.println(subkey.getName()); // You need to check here if there's anything which matches "Mozilla FireFox". } } }

1342






Addition to previous section relative word 5th one was Putrid ans: rotten, also there was prob. in 1st section on bucket weight ans:10kg, also there was a prob. on train speed to find bridge length ans:800 mtrs.

1600


What is data movement?

659


What are the 4 types of characters?

535


Define a java class.

793


What is unsigned char?

610


What is the difference between break and continue statements?

544


What do negative exponents mean?

540


Can we execute a program without main?

529


What happens if we don’t define serial version uid?

563


Can a class have 2 constructors?

490