Clan x86

Technical (Development, Security, etc.) => General Programming => Topic started by: AntiVirus on March 14, 2006, 04:09:47 PM

Title: [Java] cs1.Keyboard
Post by: AntiVirus on March 14, 2006, 04:09:47 PM
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?
Title: Re: [Java] cs1.Keyboard
Post by: Joe on March 14, 2006, 05:33:57 PM
What's it do?
Title: Re: [Java] cs1.Keyboard
Post by: MyndFyre on March 14, 2006, 05:48:31 PM
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.
Title: Re: [Java] cs1.Keyboard
Post by: AntiVirus on March 14, 2006, 11:36:32 PM
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?
Title: Re: [Java] cs1.Keyboard
Post by: Joe on March 15, 2006, 02:29:39 AM
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.
Title: Re: [Java] cs1.Keyboard
Post by: Ender on April 17, 2006, 11:16:40 PM
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>
Title: Re: [Java] cs1.Keyboard
Post by: Joe on April 18, 2006, 10:11:42 AM
public class NewEasyReader exteneds EasyReader
Title: Re: [Java] cs1.Keyboard
Post by: MyndFyre on April 18, 2006, 01:25:47 PM
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.