Results 1 to 6 of 6
Thread: what is this output?
- 01-04-2010, 03:57 PM #1
Member
- Join Date
- Dec 2009
- Posts
- 68
- Rep Power
- 0
what is this output?
Java Code:public class NewMain { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println(sc); } }
output
Java Code:run: 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]
i used to encounter some memory address representation due to some mistyping..
but what is this one... any answer would be appreciated ... just want to know what is this one....
-
You're displaying the results from the Scanner object's toString method call. For details on how this is defined, see the Scanner API: Scanner API
For more details, check out Scanner's source code that you have in a zip file on your hard drive with your JDK.
- 01-04-2010, 04:28 PM #3
Member
- Join Date
- Dec 2009
- Posts
- 68
- Rep Power
- 0
thank you sir...
- 01-04-2010, 04:30 PM #4
Member
- Join Date
- Dec 2009
- Posts
- 68
- Rep Power
- 0
ahh so if this object not calling anything from its class
it will simply return a string representation of an object, i even tried to
use the toString() method, the ouput is still the same..
-
I don't understand what you're saying here or what you're trying to do.
You rarely if ever want to call System.out.println on your Scanner object. I figured you were just doing this for experimental purposes, but I guess not.i even tried to use the toString() method, the ouput is still the same..
It's time for you to tell us just what you're trying to do, I think.
- 01-04-2010, 05:07 PM #6
Member
- Join Date
- Dec 2009
- Posts
- 68
- Rep Power
- 0
Similar Threads
-
Java, output string, getting correct output? HELP!
By computerboyo in forum New To JavaReplies: 2Last Post: 02-25-2009, 11:44 PM -
what the outPut
By alksam in forum Advanced JavaReplies: 5Last Post: 12-25-2008, 01:44 PM -
different output
By pro85 in forum Java AppletsReplies: 6Last Post: 08-05-2008, 01:42 PM -
Why the output is always zero
By mehrotra.chitij in forum New To JavaReplies: 12Last Post: 04-25-2008, 04:05 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks