Search:

Type: Posts; User: jim829

Search: Search took 0.11 seconds.

  1. Thread: Scanner

    by jim829
    Replies
    9
    Views
    3,590

    Re: Scanner

    Like I said before, if you put %n in the format statement, you don't need the extra println() calls.

    Regards,
    Jim
  2. Thread: Scanner

    by jim829
    Replies
    9
    Views
    3,590

    Re: Scanner

    System.out.println() does not permit formatting. If you want a return followed by a newline put a %n after the f (e.g. "%.2f%n"). Note. There are many formatting codes to use with printf. You...
  3. Thread: Scanner

    by jim829
    Replies
    9
    Views
    3,590

    Re: Scanner

    First, the closing code tag needs a forward, not a backward, slash.

    The problem is that you are creating two SalesTest objects when only one is needed.

    The variable getProdNumb is stored in the...
  4. Thread: Scanner

    by jim829
    Replies
    9
    Views
    3,590

    Re: Scanner

    It works for me. Did you show your exact code? BTW, closing the scanner when the Readable source is System.in is not a good idea because that will close the System.in stream and you will not longer...
  5. Thread: Scanner

    by jim829
    Replies
    9
    Views
    3,590

    Re: Scanner

    Try keyboard.close()

    Regards,
    Jim
Results 1 to 5 of 5