Results 1 to 4 of 4
  1. #1
    exopforce is offline Member
    Join Date
    Apr 2013
    Posts
    6
    Rep Power
    0

    Default keep getting an error

    [
    import java.io.*;





    public class OneSongPlayer extends AudioPlayer implements MyMedia,ShortClip
    {
    private Random select;

    private String name;


    public OneSongPlayer (String name)
    {
    super (name);
    this.id=id
    }
    public String getName() {return name;}

    public void setName (String n) {name = n;}

    public boolean equals (Object ob)
    {
    OneSongPlayer p=(OneSongPlayer) ob;
    return this.soundfile.equals (p.soundfile);
    }
    }

  2. #2
    exopforce is offline Member
    Join Date
    Apr 2013
    Posts
    6
    Rep Power
    0

    Default Re: keep getting an error

    keeps saying Random cannot be resolved

  3. #3
    monkeyjr97 is offline Senior Member
    Join Date
    Nov 2012
    Posts
    256
    Rep Power
    3

    Default Re: keep getting an error

    Sounds to me like you dont have any Random Objects.

    Make a Class called "Random" and that should solve your error, obviously make it a meaning full Class.

    Also you can just delete the line " private Random select" you don't actually reference it in your code at all.

  4. #4
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,930
    Rep Power
    5

    Default Re: keep getting an error

    You probably need to an an import statement for the Random class.

    Java Code:
    import java.util.*; // import all utilities
    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. Replies: 3
    Last Post: 05-08-2012, 06:26 PM
  2. Replies: 1
    Last Post: 03-10-2010, 02:53 PM
  3. Replies: 1
    Last Post: 12-05-2009, 08:28 AM
  4. Replies: 3
    Last Post: 01-23-2009, 09:53 AM

Posting Permissions

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