Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Using the Scanner class

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Using the Scanner class

    Hey,

    Just wondering could anyone help me as I am very new to Java coding.

    I need to use a Random Object to produce two positive integer values. I think I have this part pretty much just the next part I find difficult.

    I have to prompt the user with a question asking them to multiply said two values. The user then enters an answer through the keyboard. Here is where the scanner class comes into effect ?

    Any help would be appreciated.

    Paul


  2. #2
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 140 Times in 135 Posts

    Default Re: Using the Scanner class

    The Scanner is used to get input from the user via its methods, nextInt(), nextLine(), nextDouble(), etc.... Your best bet is to experiment as much as possible with this class to get a feel for it.

Similar Threads

  1. Does the Scanner class use an internal buffer?
    By Fazan in forum Java Theory & Questions
    Replies: 12
    Last Post: October 9th, 2012, 04:07 PM
  2. use Delimiter, Scanner Class
    By izzahmed in forum What's Wrong With My Code?
    Replies: 12
    Last Post: October 25th, 2011, 05:27 PM
  3. Scanner class error "java.lang.Error"
    By Lheviathan in forum What's Wrong With My Code?
    Replies: 2
    Last Post: September 21st, 2009, 02:23 AM
  4. [SOLVED] Problem in Coin-counter with scanner class
    By coccoster in forum File I/O & Other I/O Streams
    Replies: 6
    Last Post: March 25th, 2009, 08:46 AM
  5. Replies: 1
    Last Post: May 13th, 2008, 08:08 AM