Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package util;
- public class CuiTest {
- private ConsoleUserInterface userInterface;
- public CuiTest() {
- userInterface = new ConsoleUserInterface("CuiTest");
- CuiCommand testCommand = new TestCommand();
- userInterface.addCommand("calculate", testCommand);
- }
- public void go() {
- userInterface.start();
- }
- public static void main(String[] args) {
- new CuiTest().go();
- }
- public class TestCommand implements CuiCommand {
- @Override
- public String getDescription() {
- return "This is just for fun!";
- }
- @Override
- public void execute() {
- System.out.println("4 + 8 = " + (4 + 8));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement