Wednesday, December 9, 2009

Re: [Java] Keyboard input

 

Thanks, everyone.

I'll slink away and learn the language properly...

Best regards,

Pete Morris

--- On Tue, 8/12/09, Vinícius Souza <vs.souza@gmail.com> wrote:

From: Vinícius Souza <vs.souza@gmail.com>
Subject: Re: [Java] Keyboard input
To: Java_Official@yahoogroups.com
Date: Tuesday, 8 December, 2009, 8:34

 

Simple code for test purpose... do not try this at home... or try at your

own risk... hehehehehehe

*import *java.io.IOExceptio n;

*public class *MainClass {

*public static **void *main(String[ ] args) {

*try *{

*while *(*true*) {

*int *datum = *System.in.read* *()*;

*if *(datum == -1)

*break*;

System.out.println( datum);

}

} *catch *(IOException ex) {

System.err.println( "Couldn't read from System.in!") ;

}

}

}

On Mon, Dec 7, 2009 at 4:27 AM, Pete Morris <egnaro937@btinterne t.com>wrote:

>

>

> I'm feeling very foolish,

>

> How do you take a line of input from the keyboard?
<snip>

[Non-text portions of this message have been removed]

__._,_.___
Visit http://aiaiai.com or http://jgame.org for more groups to join.
Java Official Group is created for the following topics: Java 2 Enterprise Edition - J2EE, Java 2 Standard Edition - J2SE, Java 2 Micro Edition - J2ME, XML, XSL, XSD, XPATH, Web Services, Jini, JXTA for all type of Java Geeks.
Whoever posts spam / ads / job related message will be BANNED IMMEDIATELY
.

__,_._,___

No comments:

Post a Comment