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

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -