Tue Jan 7 19:39:37 MST 2020 Let’s talk about today than shall we? I’d like to think it would be a nice moment in time if we could simply get along with everything that happens in this life, yet I doubt it will. It’s a shame if you think about it. A real shame. But what are you going to do with any of it? No one knows exactly. So here we sit waiting for something better to come along, hoping for something to happen and allowing us to actually see what is real and what isn’t.
Here we have a simple do/while loop with the input from a Scanner going to a switch statement. import java.util.Scanner; import java.util.Date; public class Test { public static void main(String[] args) { Action action = new Action(); Scanner scanner = new Scanner(System.in); String in; do { System.out.print("> "); in = scanner.nextLine(); action.process(in); } while (!in.equals("quit")); } } class Action { public Action() { } public void process(String in) { switch(in) { case "date": date(); break; } } public void date() { System.out.println(new Date().toString()); } }