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

Why java is not 100% object-oriented?

1193


How can we find the actual size of an object on the heap?

1072


What isan abstract class and when do you use it?

1189


What is the independent variable in an experiment?

747


Difference between this() and super() in java ?

814


What is null in java?

705


Why string is a class?

731


What is polymorphism java example?

767


Why does java not support pointers?

779


What are controls and their different types in awt?

840


What is object in java?

762


Why runnable interface is used in java?

831


Explain the significance of class loaders in bootstrap?

716


What is the ==?

676


What is treemap in java?

729