Computing.Net > Forums > Programming > Java keyboard input syntax

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Java keyboard input syntax

Reply to Message Icon

Name: wures6
Date: April 30, 2004 at 17:18:31 Pacific
OS: Windows XP
CPU/Ram: Athlon XP 3000+
Comment:

Hello. This is my first time doing keyboard inputs for a Java program. What is the correct syntax? Isn't the code below the fundamentals for keyboard input?

import cs1.Keyboard;

public class Something
{
public static void main(String[]args)
{
int value;

value = Keyboard.readInt();

System.out.println(value);
}
}

There would always be errors for "import cs1.Keyboard;" and
"value = Keyboard.readInt();".



Sponsored Link
Ads by Google

Response Number 1
Name: wharfie
Date: May 2, 2004 at 16:59:50 Pacific
Reply:

the cs1 package is not part of the Java SDK so you need to ensure that this class is in your classpath when you compile.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Java keyboard input syntax

Program: Block Keyboard Input www.computing.net/answers/programming/program-block-keyboard-input/13804.html

Windows keyboard input www.computing.net/answers/programming/windows-keyboard-input/13203.html

Capturing All Keystrokes?! www.computing.net/answers/programming/capturing-all-keystrokes/14021.html