Does anyone know where to find the cs1.Keyboard package at? I looked on google and I couldn't find a site to download it at. I found a site that is asking this same question on Sun's forums, but I couldn't connect to the site.
So, does anyone know where to download it at?
What's it do?
www.google.com
"java Keyboard class" (no quotes), "I'm Feeling Lucky."
http://duke.csc.villanova.edu/jss/keyboard.html
By the way, are you doing this in high school? That's from the textbook my CSE200 class used in college.
Yeah, I got this from my highschool. Right now though, I am doing it alone and I happen to know the package pretty well, so I am going to stick with it.
Thanks MyndFyre.
Quote from: Joe on March 14, 2006, 05:33:57 PM
What's it do?
Well from what I understand it just reads what the user inputs. Such as the primitive data types and what not. It's pretty handy. :)
[Edit]
I still get this
Quote--------------------Configuration: j2sdk1.4.0 <Default>--------------------
C:\Documents and Settings\Brandon\My Documents\Java\OddNum.java:6: package cs1 does not exist
import cs1.Keyboard;
^
1 error
while trying to compile my little code. It's in all the places it should be according to the site I found, but nothing has changed.
Site: http://duke.csc.villanova.edu/jss/keyboard.html
Any ideas?
Ah. We have one of those from our textbook too. I don't know if you saw it or not when I posted it earlier. It's called EasyReader.
I have developed a distaste for classes like Keyboard and EasyReader. They should allow the user to provide some of the implementation him/herself... for example, through delegation. It's true that you can subclass these classes but they give no reason to override their methods and you can't change the error messages they spit out without editing the file (which is not always possible). For instance, they could allow for delegating an object to handle error messages. While they do a good job abstracting IO they also limit functionality... I particularly don't like EasyReader for this reason. IIRC, it does not have block IO. I find the java.io and java.nio packages to be well-suited for the job.
</rant>
public class NewEasyReader exteneds EasyReader
While your criticisms of the Keyboard and EasyReader classes may be valid, I'd argue that, as a teaching tool (which is what they are), they're very effective. Besides shielding students from the relatively mundane task of retrieving input, they teach good OO design principles. And, library usage is good; it introduces students quickly to the concept of code reuse. When someone is new, they don't necessarily understand that the Java library is actually a library of code, as opposed to an innate part of the language.