What is the default modifier in Interface?

Answer Posted / raj kumar sav

All of the methods in an interface are implicitly abstract.
Every method declaration in an interface specifies the
formal parameters and return type of the method, but it
does not include an implementation of the method.

All of the variables in an interface are implicitly static
and final.

Interface Modifiers
The keywords public and abstract can appear as modifiers at
the beginning of an interface declaration. In this
situation, these modifiers have the following meanings:


public

If an interface is declared public, it can be referenced by
any class or interface. If the public modifier is not used,
however, the interface can only be referenced by classes
and interfaces in the same package. A single source file,
or compilation unit, can only declare one public class or
interface (see Compilation Units for an exception to this
rule).


abstract

An interface is implicitly abstract; so all of the methods
in an interface are implicitly abstract. Including the
abstract modifier in an interface declaration is permitted,
but it does not change the meaning of the interface
declaration.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an off by one error in java?

736


Is boolean a data type in java?

744


Is treeset sorted in java?

781


Explain oops concepts in detail?

799


How are java objects passed to a method and what are native methods?

849


Explain about doubly linked list

840


What is bitwise complement?

738


How many digits can a float hold?

770


Is there any tag in htm to upload and download files?

851


Explain about automatic type conversion in java?

848


What is the use of java?

745


Why java is platform independent? Explain.

805


Explain parallel processing in java8?

919


Explain about complier design(phases)

858


What does sizeof return?

775