what are the different access specifiers that can be used
by interfaces and abstract classes? can anyone give me
detailed description on this

Answer Posted / vishal arora

This question leads to two things
1. modifier for abstract class or interface
2. modifier for members of abstarct class or interface

For first in abstract class and interface we can have
public , protected and default and not private if it is top
level otherwise private also if it is nested

for point 2
in an interface every member variable is public and final
in an abstract class you can assign any modifier to member
variables

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is lifetime variable?

521


What is a local block?

636


How does a for loop work?

504


Compare Mutex and Semaphore in java.

556


Are registers volatile?

526






What is the purpose of encapsulation?

538


Explain importance of throws keyword in java?

560


How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?

539


How many java versions are there?

556


Why stringbuilder is not thread safe in java?

566


What is ctrl m character?

510


How does enum work in java?

542


What is a prefix function.write down a code to compute prefix function.

534


What is a memory leak in java?

542


Which object oriented concept is achieved by using overloading and overriding?

551