Call for New Batch / Any Query / Demo Classes : ☎ 08871209400 , 7987028543 , Zone-2,M.P.Nagar,Bhopal

Interface Inheritance Java

An Interface declaration consists of modifiers, the keyword interface, the interface name, a comma-separated list of parent interfaces, and the interface body. For example:



public interface GroupedInterface extends Interface1, Interface2, Interface3
{

    // constant declarations
    
    // base of natural logarithms
    
    double E = 2.718282;
 
    // method signatures
    
    void doSomething (int i, double x);
    int doSomethingElse(String s);
}
   

The public access specifier indicates that the interface can be used by any class in any package. If you do not specify that the interface is public, then your interface is accessible only to classes defined in the same package as the interface.

An interface can extend other interfaces, just as a class subclass or extend another class. However, whereas a class can extend only one other class, an interface can extend any number of interfaces. The interface declaration includes a comma-separated list of all the interfaces that it extends.

The Interface Body

The interface body can contain abstract methods, default methods, and static methods. An abstract method within an interface is followed by a semicolon, but no braces. Default methods are defined with the default modifier, and static methods with the static keyword. All abstract, default, and static methods in an interface are implicitly public, so you can omit the public modifier.

In addition, an interface can contain constant declarations. All constant values defined in an interface are implicitly public, static, and final.

References : Oracle share on :        :  

Love to hear your Views / Guidance / Recommendations on this Post…

Explore the Technology World

How to Build an App for the Google AssistantApps for the Google Assistant are the gateway for your users to engage with your services through Google Home, Android phones, iPhones.Watch here to build an as ...Read MoreIntroduction to AMP - Accelerated Mobile PagesAMP, short for Accelerated Mobile Pages, is new new open source initiative to make the mobile web awesome again.Watch Here the Introduction to AMP ...Read MoreHadoop - Just the Basics for Big Data Rookies (Best online tutorial)This Tutorials assumes absolutely no knowledge of Apache Hadoop and will provide a complete introduction to all the major aspects of the Hadoop ecosystem of pro ...Read MoreGoogle Python online tutorial-Interested in learning python? Then you must watch this videoPython is a dynamic, interpreted (bytecode-compiled) language. There are no type declarations of variables, parameters, functions, or methods in source code.wat ...Read Morelatest product and platform innovations at Google by Sundar PichaiLearn about the latest product and platform innovations at Google in a Keynote led by Sundar Pichai.Video is also subtitled in Chinese, Indonesian, Italian, Jap ...Read MoreFuture of the Java Platform and the JDKJava has been one of the most popular programming platforms in the world for twenty-three years as One Language, One Platform, a Lifetime of Opportunity. How d ...Read More

Call / Visit for New Batch

Services

Why Join Us

  • ➯ Free Demo Classes
  • ➯ No Registration Fee
  • ➯ Interview Questions
  • ➯ Study Materials
  • ➯ Softwares
  • ➯ Aptitude & Reasoning
  • ➯ Placement Assitance

Address

  • MyJava Training Institute ,
  • Plot No.243 , shop No 14 ,
  • Secnd Floor , Zone-II ,
  • M.P.Nagar , Bhopal,
  • Madhya Pradesh ( 462011 )
  • ☎  08871209400 , 7987028543
  • 🌐 www.myjava.in
FacebookGoogle +TwitterYouTube

MyJava - java Training Institute