Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

A problem in system.in.read

$
0
0
public static void main(String args[]){
		int x=1 ;
		try{
			x=(int) System.in.read();
		}
		catch(Exception e){}
		System.out.println(x);
	}


When I input "1" the output is 49. I cant understand why

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>