java - Package that calls different classes when given input to? -
i have taken of classes intro java college in highschool class, , put them package called gamechoices. made class call these classes when user asks them, called whichgame. i've imported classes want called using import gamechoices."whatever game is";. how call these classes in whichgame? have them public static main(string [] args), ones shouldn't have that(i think it's whichgame should..)? , put instead? helping newbie out :)
the simplest way set big if/then statement.
if(input.equals("t")) thisone.start(); else if(input.equals("a")) anotherone.start(); else if(input.equals("y")) yetanotherone.start(); and on. might pain if have lot of classes, or if start same letter.
Comments
Post a Comment