Re: Need help,homework
theunk...@lavabit.com wrote:
Nooblet here, I need to write this application, I got as far as making 6
empty classes and originally needed to use swing, though since I need to
learn swing I may just make it a console application and get less points
for it. I need to be able of writing to disk the data (utilizing user
input), deleting it when I want too and show I understand how classes
work. While I understand extends, I don't quite understand what implement
does.
Extends allows you to use the methods and variables of the class you
extended (inheritance). Implement seems similar?
'extends' is the keyword to inherit from a class, including implementation of methods.
'implements' is the keyword for a _class_ to inherit from an interface, including only
method signatures from the interface and leaving details of implementation entirely
up to the implementing class.
An interface can use 'extends' to inherit from another interface. Because an interface
contains no implementation, it cannot 'implements' an interface.
Anyways, since I only have 1 day to do this and I've been trying to do
You're going to have a hard time. Usenet isn't necessarily a one-day turnaround, and
learning Java can take a few days.
this for weeks, what are the classes available that will allow me to:
Tutorials and Javadocs.
Tutorials:
http://docs.oracle.com/javase/tutorial/
Javadocs:
http://docs.oracle.com/javase/7/docs/api/
1.) Write a plain text file to disk?
http://docs.oracle.com/javase/tutorial/essential/io/index.html
http://docs.oracle.com/javase/7/docs/api/java/io/FileWriter.html
2.) read the file?
http://docs.oracle.com/javase/7/docs/api/java/io/FileReader.html
3.) delete the file?
http://docs.oracle.com/javase/7/docs/api/java/io/File.html
4.) check for the existence of the file?
http://docs.oracle.com/javase/7/docs/api/java/io/File.html
5.) search for the file?
http://docs.oracle.com/javase/7/docs/api/java/io/File.html
plus
http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html
plus
http://docs.oracle.com/javase/7/docs/api/java/io/FilenameFilter.html
plus glue code.
6.) compare files?
Read the files and compare contents. You'll need to be more specific about what you
mean by "compare".
Where can I learn more about these specific classes? Any example code that
is small and simple to read? :(
http://lmgtfy.com/?q=Java+simple+file+I%2FO
--
Lew