Results 1 to 4 of 4
  1. #1
    Dissonance is offline Programming Again
    Join Date
    May 2012
    Location
    Eugene, OR
    Posts
    55
    Rep Power
    0

    Default Interface question

    Hello! About 9-10 years ago someone showed me how to use an interface to associate lists of two data types or objects. (I am probably not describing it well because I don't know what it's called.) For example, the interface keeps track of a list of strings that correspond to a list of integers.

    int 1 String "a"
    int 2 String "b"
    int 3 String "c"
    etc

    I forget how to do it. Would someone please point me to an example or documentation?

    Thanks!

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: Interface question

    It sounds as if you are describing a Map, such as a Map<String, Integer> for the interface and HashMap<String, Integer> for one possible concrete type.

  3. #3
    Dissonance is offline Programming Again
    Join Date
    May 2012
    Location
    Eugene, OR
    Posts
    55
    Rep Power
    0

    Default Re: Interface question

    That sounds exactly right. I'm reading about it in the API now. Thanks!

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: Interface question

    Nothing whatsoever to do with Applets. Moving to New to Java

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Question about Interface Collection<E>
    By yma16 in forum New To Java
    Replies: 2
    Last Post: 04-11-2011, 04:00 AM
  2. Question concerning interface functionality
    By Morning-owl in forum New To Java
    Replies: 3
    Last Post: 04-04-2011, 09:25 PM
  3. Interface Question
    By superman1938 in forum Advanced Java
    Replies: 1
    Last Post: 12-14-2010, 05:28 AM
  4. question on listener interface
    By Minu in forum Java Servlet
    Replies: 1
    Last Post: 01-16-2009, 11:33 AM
  5. Interface question in java
    By tony404 in forum Advanced Java
    Replies: 2
    Last Post: 06-27-2008, 12:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •