Results 1 to 7 of 7
- 10-30-2010, 01:15 PM #1
Member
- Join Date
- Oct 2010
- Posts
- 3
- Rep Power
- 0
Cannot find symbol variable Keyboard...
Hi, I'm new to Java, and I started out with my first class- I'm using Jcreator LE as an IDE and well, it's giving me an error every time I compile, saying 'Cannot find symbol variable Keyboard' and pointing towards the input statements. Please can someone tell me what I'm doing wrong and how to fix it? Here's my code;
/**
*My First Class
*/
public class HelloWorld {
public static void main (String args [] ) {
String name;
int age;
System.out.print("Enter your name: ");
name = Keyboard.readString(); //Pointing at this line...
System.out.print("Enter your age: ");
age = Keyboard.readInt(); //It's pointing me at this line too...
System.out.println("My name is " + name +
" and I am " + age + " years old.");
}
}
-
What is Keyboard? Where and how have you used this before? Are you trying to use a Scanner object or is this in some 3rd party library that needs to be included in your program?
- 10-30-2010, 02:42 PM #3
Member
- Join Date
- Oct 2010
- Posts
- 3
- Rep Power
- 0
well, want i want to do is input the input by the user by typing from the keyboard, as i was following an example in my notes...
- 10-30-2010, 02:44 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,375
- Blog Entries
- 7
- Rep Power
- 17
-
- 10-30-2010, 04:59 PM #6
Member
- Join Date
- Oct 2010
- Posts
- 3
- Rep Power
- 0
thanks all for your quick replies, i'll make sure i'll ask my teacher about it, i'll post you how it went.
-
Good luck. Note that if you will be using an object of the Scanner class, you'll need to change the method names to those used by Scanner objects such as nextInt() and nextLine().
Similar Threads
-
Objects and Classes cannot find symbol variable.
By argnsoccer in forum New To JavaReplies: 22Last Post: 10-28-2010, 12:23 AM -
Java cannot find symbol- variable img
By crutchfieldj in forum New To JavaReplies: 3Last Post: 04-13-2010, 10:47 PM -
Cannot find symbol variable - Why? I can.. ^^
By Mattedatten in forum New To JavaReplies: 4Last Post: 03-08-2010, 07:07 PM -
Cannot find symbol variable pD! I cant fix it!!!
By Addez in forum New To JavaReplies: 2Last Post: 09-17-2009, 08:32 PM -
Cannot find symbol variable yourScore
By Addez in forum New To JavaReplies: 4Last Post: 08-17-2009, 10:48 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks