Hi all, I'm new to java and I found this site as a great resource among other. Right now I'm having some money troubles so I havent had a chance to go out and get a book to buy or buy driving to the library (might be a good thing to just ride my bike and do.) anyways I'm having a bit of toruble working on a new project. The program takes a number the user inputs in the cmd line and prints the square of it, easy enough right? Well it seems I'm having trouble compiling this with netbeans IDE 5.5.1
Here is the source of the origional
here is the compile log
init: deps-jar: Created dir: C:\Java\testing2\build\classes Compiling 1 source file to C:\Java\testing2\build\classes C:\Java\testing2\src\testing2\Main.java:15: cannot find symbol symbol : variable TextIO location: class Square userInput = TextIO.getInt(); 1 error BUILD FAILED (total time: 1 second)
However the tutorial on this required that I use a file for the TextIO class, how would I go about doing this without that?
Thanks for any help -John-
[ June 28, 2007: Message edited by: John Murray ] [ June 28, 2007: Message edited by: John Murray ]
Did you import the TextIO class or put it in your path? The compiler needs to know where to find TextIO. You could just put it in the same folder as the class you are writing, I am not sure that is the best solution, but it is certainly the easiest.
Where did you get that class? Is it just a wrapper for standard Java IO classes? If it is, I recommend using the standard IO classes from the beginning. These kinds of classes aren't really hiding a whole lot. They are just getting you used to using a non-standard class. Just my opinion. BufferedReader or Scanner should do what you need. [ June 28, 2007: Message edited by: David McCombs ]
"Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration."- Stan Kelly-Bootle
Joined: Jun 28, 2007
NVM had to import class from a diff file from a tutorial(that is why I should just be slapped with a trout), what I meant was how could I get the users input as an integer. [ June 28, 2007: Message edited by: John Murray ]
Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.
Please edit your profile and correct your display name since accounts with invalid display names get deleted, often without warning
Joined: Jun 28, 2007
Not gunna lie to you, I'm pretty well lost reading all of that between the two links. I fell pretty dumb right now I'm going to go spend some time researching a few words I don't understand in the links. I feel like I can see the bottom of the lake but when I jump in it's actually alot deeper, Might be a fun lake to swim in for awhile though [ June 28, 2007: Message edited by: John Murray ]