Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Java Tutorial 8 : Scanner, Parsing

Loading...

Sign in or sign up now!
20,759
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Apr 14, 2008

Using the Scanner class to get user input from the command line and getting an integer out of a String.

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 3 dislikes

Link to this comment:

Share to:

Top Comments

  • Much Easier:

    To get an int: sc.nextInt();

    To get a char: sc.next().charAt(0);

    To get a double: sc.nextDouble();

    See, no parsing... Much less confusing and less typing

  • I was looking for solutions to scan characters EVERYWHERE! 5 stars.

see all

All Comments (19)

Sign In or Sign Up now to post a comment!
  • How do you have the program say what us your nem? And you reply your name and the have it say hello (name)?

  • @leemorethomas old school? lol.. im doing a degree in Computer Science and Artificial Intelligence.. Keyboard is very handy for students.. plus in real life you will barely need the use of such a thing like scanner and Keyboard. because any modern program would take inputs from GUI..

  • @drinu93 Keyboard is old school. I'm guessing Your Senior. Let me know if you need Junior assistance to ease the load. I love Java.

  • Ok... i've spent the past 30 minutes just trying to find how to parseInt. (syntax) and this is the first tutorial/info that has made any sense to me. I wasn't putting Integer.parseInt, i was putting the string, st2.nextToken().parseInt. LOL fail. THANK YOU FOR SAVING MY SANITY :)

  • just use the Keyboard Class.. you can find it on the net.. no need for inports of initializing just 1 line ex:

    System.out.print("enter name ");

    String name = Keyboard.readString();

    just download that :)

  • Let's go on other java tutorial videos and criticize them!

  • Nice intro to scanners. Thanks.

  • Thanks so much. This is the best vid on scanners out there in my opinion :)

  • Audio is OK, when you use headphones.

Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more