Java Programming Tutorial - 6 - Getting User Input

Java Programming Tutorial – 6 – Getting User Input



Facebook – https://www.facebook.com/TheNewBoston-464114846956315/
GitHub – https://github.com/buckyroberts
Google+ – https://plus.google.com/+BuckyRoberts
LinkedIn – https://www.linkedin.com/in/buckyroberts
reddit – https://www.reddit.com/r/thenewboston/
Support – https://www.patreon.com/thenewboston
thenewboston – https://thenewboston.com/
Twitter – https://twitter.com/bucky_roberts

source

37 comments

  1. Scanner sc = new Scanner(System.in);
    String hi = sc.next();
    if (hi=="hello") {
    System.out.println("hello");
    }

    I don't get an error message, so I've imported it correctly.
    Why doesn't it print hello if I type hello or "hello"?

  2. I am facing an issue. The ide doesn't autocomplete the braces or quotation sign. I've enabled smart insert mode and ticked all the options in the editor>typing but it still doesn't work.

  3. My understanding is that
    whatever the user inputs(types in), will be scanned and become the definition of the scanner variable called bucky(hey now).
    Then, the scanner variable will be out putted because he programmed system.out.println(bucky).

    However,
    I have no idea what (system,in) is ? and why do we do that ?

    Someone said it is used for strings, but what are strings?

Comments are closed.