PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, October 26, 2022

[FIXED] why interface used in java

 October 26, 2022     inheritance, java, oop     No comments   

Issue

Possible Duplicate:
why we need interface in java?

I refered the following link

prevoius post

can anyone explain any reason why we are using interface in java?

Other than

  • multiple inheritance is possible with interfaces.
  • polymorphism

Solution

Other than what you have mentioned, interfaces are a good way of exposing a set of functions (API) without divulging any information on their implementation.

By definition, when a class implements an Interface, it is agreeing to implementing a series of methods. This will allow any caller to use these methods without:

  • The caller having to worry about how is the function implemented;
  • Whoever wrote the function to worry about exposing internal logic.


Answered By - npinti
Answer Checked By - Clifford M. (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing