Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8124291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:25:16+00:00 2026-06-06T06:25:16+00:00

I am new to java and learning interfaces. I did not understand the use

  • 0

I am new to java and learning interfaces. I did not understand the use of interfaces other than just standardizing the expectation.

If there is any other uses please help me to understand that.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T06:25:19+00:00Added an answer on June 6, 2026 at 6:25 am

    Interfaces have a few good uses:

    Polymorphism

    They allow you to treat several different, but similar, objects in the same way. For example:

    public interface Flyer {
      public void fly();
    }   
    
    public class Bird implements Flyer {
      @Override
      public void fly() {
        System.out.println("I'm flying");
      }   
    }   
    
    public class Airplane implements Flyer {
      @Override
      public void fly() {
        System.out.println("I'm inanimate and flying");
      }   
    }   
    
    // then you can have a method like so:
    public void makeFly(Flyer flyer) {
      flyer.fly();
    } 
    
    // or make a list like so:
    List<Flyer> fliers = Arrays.asList(new Airplane(), new Bird());
    

    They also allow Objects to fit into several different boxes. For example, a Bird not only flies, but it is an Animal. Interfaces allow you to treat Bird as either one:

    public interface Animal {
      public void move();
    }
    
    public class Bird implements Flyer, Animal {
      @Override
      public void fly() {
        System.out.println("I'm flying");
      }   
    
      @Override
      public void move() {
        fly();
      }
    }
    
    // now I can do:
    Bird bird = new Bird();
    Flyer flyer = new Bird();
    Animal animal = new Bird();
    

    Decoupled Design

    Additionally, they give you flexibility in choosing your implementation. (I’m not sure what you mean by “Standardizing the Expectation”, but this use is probably most related to standardization. i.e. This works because it creates a standard.) For example, say I have a method that returns a List<Flyer>. Since List is an interface, I can choose use ArrayList, LinkedList, etc. as my implementation:

    public List<Flyer> makeFlyerList() {
      return new ArrayList<Flyer>(Arrays.asList(new Airplane(), new Bird()));
    }
    
    // works just the same
    public List<Flyer> makeFlyerList() {
      return new LinkedList<Flyer>(Arrays.asList(new Airplane(), new Bird()));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm really new to java and slowly learning so not sure if there is
I'm new with Java and just learning... but how would you write a program
I am new to java(learning JSF and other JAVA EE components) and have a
I am new to Java and learning how to export applications to .jar files.
I am fairly new to learning C# (from Java & C++ background) and I
I'm new in Java and learning Java ME development. I got stuck in this
I'm fairly new to java. I'm reading up on it and learning as I
I'm pretty new to java and really enjoying learning about it. I have made
I am new to my position, and am in the process of learning Java
hi i am learning about Java interfaces. I read in Java tutorial that an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.