Tuesday, July 28, 2020

Console Input

There are times you wish to gather input from the console. There are a few ways of doing this. Here is one way of getting input from the user via the console:


public class Test {

  public static void main(String[] args) {
    String in;
    in = System.console().readLine();
    System.out.println(in);
  }
}

No comments:

Post a Comment

Slump

 I feel like I'm in a slump. I can't even think of what to write about. The cursor just sits there. It's a staring match that wo...