Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #20236

Re: Need help,homework

Newsgroups comp.lang.java.programmer
Date 2012-12-10 17:05 -0800
References <ka5ua2$2k8$1@dont-email.me>
Message-ID <fb2c1476-86cf-4478-abec-f03647df7f22@googlegroups.com> (permalink)
Subject Re: Need help,homework
From Lew <lewbloch@gmail.com>

Show all headers | View raw


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

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Need help,homework theunknowable@lavabit.com - 2012-12-11 00:21 +0000
  Re: Need help,homework Lew <lewbloch@gmail.com> - 2012-12-10 17:05 -0800
  Re: Need help,homework Roedy Green <see_website@mindprod.com.invalid> - 2012-12-11 18:37 -0800
    Re: Need help,homework Lew <lewbloch@gmail.com> - 2012-12-11 19:30 -0800
    Re: Need help,homework Arne Vajhøj <arne@vajhoej.dk> - 2012-12-12 20:42 -0500
      Re: Need help,homework Robert Klemme <shortcutter@googlemail.com> - 2012-12-14 08:03 +0100
        Re: Need help,homework Arne Vajhøj <arne@vajhoej.dk> - 2012-12-14 20:59 -0500

csiph-web