Results 1 to 2 of 2
  1. #1
    GiorgioCasini is offline Member
    Join Date
    Jan 2012
    Posts
    1
    Rep Power
    0

    Default Putting randomized classes that run when you run another class

    Ok, so i'm trying to make a random phrase generator, such as you run the class, and it pulls and runs other classes.

    I have a few premade text classes, pretty much just the basic "hello world!" class, with different texts. i'm trying to use this for a joke randomizer, as i'm still learning basic java, but i thought this would be a useful method to learn

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

    Default Re: Putting randomized classes that run when you run another class

    You may be confusing data with code as I don't see where multiple classes come in here as you're using them. Yes, I see you creating a Joke class and a JokeTeller class, but that's about it. The jokes themselves are data, are written in a text file or database on disk. Then the JokeTeller class would read in the data, create Joke objects from the data and place these Joke objects into an ArrayList of Joke , declared as ArrayList<Joke>. But you wouldn't create a new class for each joke.

Similar Threads

  1. Divide Class Into 2 or more Classes
    By ŖΫ ỏ Ңόρę in forum New To Java
    Replies: 4
    Last Post: 03-29-2011, 01:19 AM
  2. how to split class into two classes?
    By ruud00000 in forum Java Applets
    Replies: 0
    Last Post: 12-31-2010, 04:45 PM
  3. Replies: 2
    Last Post: 10-21-2010, 03:30 PM
  4. (API)Randomized Problem ..please suggest me
    By picky in forum New To Java
    Replies: 3
    Last Post: 02-12-2010, 02:52 PM
  5. Replies: 0
    Last Post: 05-13-2008, 07:16 AM

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
  •