Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void playCelebration(String celebrationName) {
- celebrationName = "play" + celebrationName.replaceAll(" ", "");
- try {
- Method method = getClass().getMethod(celebrationName);
- method.invoke(this);
- } catch (NoSuchMethodException | SecurityException |
- IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement