0

Hello,

Could you explain the output for the program below? Is the output specifying a reference of the Scanner object in RAM (I don't see any hex hash) or something else?

Thank you!

    import java.util.Scanner;

        public class ScannerTest
        {
            public static void main(String args[])
            {
                Scanner input = new Scanner(System.in);

                System.out.println ("Scanner = " + input);

            }
        }


Scanner = java.util.Scanner[delimiters=\p{javaWhitespace}+][position=0][match valid=false][need input=false][source closed=false][skipped=false][group separator=\,][decimal separator=\.][positive prefix=][negative prefix=\Q-\E][positive suffix=][negative suffix=][NaN string=\Q�\E][infinity string=\Q∞\E]

Edited by sciprog22

3
Contributors
3
Replies
30
Views
2 Years
Discussion Span
Last Post by sciprog22
0

The data from the scanner is binary. You are trying to output that as text. You need to decode the binary data first.

0

Hello rubberman and avd - thanks a lot for the reply!

rubberman - how do I go about decoding the binary data?

Thank you!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.