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 4 of 4

Thread: Question about interfaces

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Location
    Chandler, Arizona, USA
    Posts
    25
    My Mood
    Devilish
    Thanks
    10
    Thanked 2 Times in 2 Posts

    Default Question about interfaces

    I really just suspect this, but I'm asking to confirm one way or the other.

    In the study books I have read about interfaces, all of the examples I have seen so
    far show the interface being created, then the functions placed in whatever class
    they seem to be working with at the time. Yet they say that you create interfaces
    so that they can be used by more than one class or project type. This leads me to
    believe that perhaps in the real coding world, you would actually create the interface
    and the implementation separate, and then just use it in whatever class you are
    working on as the need arises. The reason I think this makes more sense is it
    seems a cleaner approach as opposed to mixing it in with a class that you could
    very well end up discarding, which would then break the functionality of any other
    classes you used the interface in. Am I correct?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Question about interfaces

    You should at least fix the line breaks when you copy and paste text into a forum.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Oct 2013
    Location
    Chandler, Arizona, USA
    Posts
    25
    My Mood
    Devilish
    Thanks
    10
    Thanked 2 Times in 2 Posts

    Default Re: Question about interfaces

    Quote Originally Posted by Norm View Post
    You should at least fix the line breaks when you copy and paste text into a forum.
    You have drawn the wrong conclusion; I did not paste this in. I use a 42" television
    as my computer monitor . . . . hence the "wideness".

  4. #4
    Member
    Join Date
    Nov 2013
    Location
    Bangalore, India
    Posts
    70
    My Mood
    Cool
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Default Re: Question about interfaces

    Yes implementation can be many for a single interface. For Example you can have an interface called car and in turn this interface could be implemented by many like Ford,Toyota,Honda etc.

  5. The Following User Says Thank You to dineshj83 For This Useful Post:

    Skywola (November 26th, 2013)

Similar Threads

  1. Interfaces
    By TP-Oreilly in forum Java Theory & Questions
    Replies: 14
    Last Post: July 13th, 2018, 12:57 AM
  2. Interfaces...
    By eggpulusu in forum Java Theory & Questions
    Replies: 1
    Last Post: September 17th, 2013, 10:52 AM
  3. General question about Interfaces
    By michael.duffy31 in forum Java Native Interface
    Replies: 5
    Last Post: June 30th, 2013, 02:44 PM
  4. Question Regarding Interfaces
    By davidrobin in forum Object Oriented Programming
    Replies: 1
    Last Post: April 18th, 2013, 04:10 PM
  5. Interfaces
    By leyland in forum Java Theory & Questions
    Replies: 4
    Last Post: April 5th, 2011, 08:51 PM

Tags for this Thread