Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Interface

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Interface

    hey guys i am not getting one point that where to use implements and where extends...

    please make me understand..

    interface I1{
      void greet();
    }
    interface I2{
       void show()
    }
    interface I3 extends I1,I2{ // why we use extends here rather than implements
       void info();
    }


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Interface

    Have you read the Java tutorials on the subjects? I'm going to request you start there and then come back with any questions you have after that.

    What is an interface?
    Interfaces and Inheritance (read both trails)

  3. #3
    Member andbin's Avatar
    Join Date
    Dec 2013
    Location
    Italy
    Posts
    443
    Thanks
    4
    Thanked 122 Times in 114 Posts

    Default Re: Interface

    Quote Originally Posted by gautammuktsar@gmail.com View Post
    that where to use implements and where extends...
    A class can extend only one other class and can implement N interfaces.
    An interface can extend N other interfaces.

    These are the basic rules.
    Andrea, www.andbin.netSCJP 5 (91%) – SCWCD 5 (94%)

    Useful links for Java beginnersMy new project Java Examples on Google Code

Similar Threads

  1. Interface?
    By jean28 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: November 14th, 2012, 01:02 AM
  2. Interface Help
    By jean28 in forum Java Theory & Questions
    Replies: 2
    Last Post: November 5th, 2012, 10:01 PM
  3. Interface
    By Samaras in forum Java Theory & Questions
    Replies: 2
    Last Post: August 4th, 2012, 05:27 PM
  4. Interface
    By kaasi in forum Member Introductions
    Replies: 4
    Last Post: April 21st, 2011, 10:45 AM
  5. interface
    By nasi in forum Object Oriented Programming
    Replies: 5
    Last Post: September 2nd, 2010, 10:36 PM