[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Interfaces

Posted on 2011-04-25
4
Medium Priority
?
210 Views
Last Modified: 2012-05-11

Interfaces allow the construction of nonhierarchical type frameworks.I have not clearly understood this statement, concept.
Please advise. Any ideas, sugestions, sample code, links, resources highly appreciated. thanks in advance
0
Comment
Question by:gudii9
  • 2
4 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 35463797
I once wrote a lot about interfaces in response to one of the EE questions, you may
read it here:
http://www.experts-exchange.com/Programming/Languages/Java/Q_26785479.html
0
 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 800 total points
ID: 35463806
Interfaces allow the construction of nonhierarchical type frameworks -
this statement emphasizes that if inheritance in Java implies
strictly hierarchical structure because a class can inherit only
from one class, interfaces allow to attribute to a Java class
proprties of a wide range of types - a class can implement
as many interfaces as you like, which creates a network of connections between
types/classes which does not need to be hierarchical
0
 
LVL 92

Assisted Solution

by:objects
objects earned 200 total points
ID: 35463884
0
 
LVL 28

Accepted Solution

by:
dpearson earned 1000 total points
ID: 35465496
A hierarchy is when class A extends B extends C.  A is derived from B which is derived from C.  It's a chain where each class has a single parent.  This means it's a hierarchy and is how Java does inheritance.

With interfaces, you're allowed to implement multiple interfaces at once.  So we can have:
class A implements I,J,K
class B implements I,J,K

both A and B implement the same classes, but they're not related to each other at all.  They don't have any of the same parent classes, so they're not part of a hierarchy.  It might look like they are derived from I,J,K - but they're implementing the interfaces, not deriving from classes.

Doug
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
A solution for Fortify Path Manipulation.
This video teaches viewers about errors in exception handling.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month18 days, 12 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question