Results 1 to 2 of 2
- 01-26-2012, 06:44 PM #1Member
- Join Date
- Jan 2012
- Rep Power
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
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.
- By ŖàΫ ỏƒ Ңόρę in forum New To JavaReplies: 4Last Post: 03-29-2011, 12:19 AM
- By ruud00000 in forum Java AppletsReplies: 0Last Post: 12-31-2010, 03:45 PM
- By sebb in forum New To JavaReplies: 2Last Post: 10-21-2010, 02:30 PM
- By picky in forum New To JavaReplies: 3Last Post: 02-12-2010, 01:52 PM
- By vitalstrike82 in forum Web FrameworksReplies: 0Last Post: 05-13-2008, 06:16 AM