Results 1 to 5 of 5
  1. #1
    pyler is offline Member
    Join Date
    Jul 2012
    Posts
    18
    Rep Power
    0

    Default implementing generic hashtable contains method

    would it be
    Java Code:
    @Override
    public boolean contains(T param){
    return hashTable[function(param)]!=null;
    }

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,307
    Rep Power
    25

    Default Re: implementing generic hashtable contains method

    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    pyler is offline Member
    Join Date
    Jul 2012
    Posts
    18
    Rep Power
    0

    Default Re: implementing generic hashtable contains method

    Quote Originally Posted by Norm View Post
    No luck yet
    Last edited by pyler; 12-06-2013 at 01:09 PM.

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,432
    Blog Entries
    7
    Rep Power
    20

    Default Re: implementing generic hashtable contains method

    Quote Originally Posted by pyler View Post
    would it be
    Java Code:
    @Override
    public boolean contains(T param){
    return hashTable[function(param)]!=null;
    }
    It depends on 'function( ...)' and on the array 'hashTable' ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,846
    Rep Power
    5

    Default Re: implementing generic hashtable contains method

    Quote Originally Posted by pyler View Post
    would it be
    Definitely maybe!
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. how hashtable and equals method has been called?
    By varun42 in forum New To Java
    Replies: 5
    Last Post: 10-07-2013, 10:59 AM
  2. help with implementing Generic Array class
    By aqeel2010 in forum New To Java
    Replies: 2
    Last Post: 11-29-2011, 08:40 AM
  3. Replies: 2
    Last Post: 12-14-2010, 04:10 PM
  4. Help implementing a method
    By VinceGuad in forum New To Java
    Replies: 3
    Last Post: 03-16-2009, 07:39 AM
  5. Hashtable-put method
    By new_1 in forum New To Java
    Replies: 1
    Last Post: 12-23-2007, 07:07 PM

Tags for this Thread

Posting Permissions

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