Results 1 to 2 of 2
  1. #1
    fabunmi is offline Member
    Join Date
    May 2010
    Posts
    1
    Rep Power
    0

    Default Please help, this code has dissapointed me

    please i need an idea of how to prevent duplication,i wrote a code to read from text file and store in an array and also to do random selection on the array element using the index but later, that was achieved but i used hash set to remove duplicate bot it is not working, what can i do

  2. #2
    m00nchile is offline Senior Member
    Join Date
    Feb 2010
    Location
    Ljubljana, Slovenia
    Posts
    470
    Rep Power
    5

    Default

    Random selection is achieved easier on structures that store elements based on index. One such structure is Vector, look through the API for it, and you'll also find a nifty little method that can prevent duplicaton. I'd also suggest that in the future, try to be clearer about what you are doing and what you need help with. Also, have a look at this:
    The Short, Self Contained, Correct (Compilable), Example or SSCCE (taken from Fubarables sig).
    Posting an SSCCE of what you are trying to acomplish will make your question more understandable, and people will be more eager to answer.
    Ever seen a dog chase its tail? Now that's an infinite loop.

Similar Threads

  1. Replies: 1
    Last Post: 03-04-2010, 11:19 AM
  2. Convert java code to midlet code
    By coldvoice05 in forum New To Java
    Replies: 1
    Last Post: 08-12-2009, 11:14 AM
  3. Convert java code to midlet code
    By coldvoice05 in forum Advanced Java
    Replies: 1
    Last Post: 08-09-2009, 01:21 PM
  4. I need help fixing my code.. or non code?
    By MrHuggykins in forum New To Java
    Replies: 1
    Last Post: 03-19-2008, 10:12 PM
  5. Replies: 1
    Last Post: 04-26-2007, 03:52 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
  •