Exforsys
+ Reply to Thread
Results 1 to 5 of 5

Unique use of Interface

This is a discussion on Unique use of Interface within the Java forums, part of the Programming Talk category; We have been using interface in many ways. But i still struggle to find out the unique reason of interface. ...

  1. #1
    mcavignesh is offline Junior Member Array
    Join Date
    Jul 2010
    Answers
    1

    Post Unique use of Interface

    We have been using interface in many ways. But i still struggle to find out the unique reason of interface. ie. The thing which cannot be done in Java without Interface. One certain example is Multiple Interface cannot be achieved w/o interface. I need some more reasons. If anyone knows please share it.


  2. #2
    softech is offline Banned Array
    Join Date
    Jun 2010
    Answers
    3
    i. Interface in java is used for implemntion the concept of polymerphism i.e a behaviour can behave differently depading upon the requirment. and situation where it is used.
    i.e suppose i declared a interface called as calculateArea and in that i am declering a methood named as area. whennever i ll implement that interface as the rule of interface says that i have to provide the implementation for the area methood.
    so if i implement that interface in Circle class then i ll provide the implementation for the area methood of interface as to calculate the area of the circle.


  3. #3
    nikkj is offline Junior Member Array
    Join Date
    Aug 2010
    Answers
    1

    Hi

    Multiple Inheritance is not directly supported by Java but it can be achieved through Interface and so the unique use of Interface is to support multiple inheritance in Java.


  4. #4
    suresh.sa is offline Junior Member Array
    Join Date
    Nov 2010
    Answers
    1

    Thumbs up

    The unique usage of the interface is just to support the multiple inheritance in the java, since java wont support multiple inheritance.


  5. #5
    Ashif Shadab is offline Junior Member Array
    Join Date
    Dec 2010
    Location
    New Delhi, India, India
    Answers
    3
    Hi, it is rally true but there is one thing which the Interface is mainly boarn is Interface data member is constant.


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...