Hi,

How to read Int from stdin?

I have this code:

import x10.io.Console;
public class Tes {
    public static def main(args: Array[String](1)) {
        val s = Console.IN.readInt();
        Console.OUT.println( s );
    }
}


When I give input 123 in console, I get 825373450 as the output instead of
123. What's happened?
Is there any correct and easy way to input an integer (aside from reading
as String and parse it as Int)?


Thanks.


Suhendry Effendy
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to