Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

TreeMaps, Collections, Arrays...

  Asked By: Viveka    Date: Mar 27    Category: Java    Views: 891
  

The program is mostly done and does compile but doesn't give the
correct output. The problem seems to be in the main where I am
supposed to write some kind of a loop to get file names: i.e.

To save you some tinkering with the body of the loop you will be
writing in main, here's a hint. For a TextFile object tf , the String
you want to print is

tf.getOwner() + '\t' + tf.getSize() + '\t' + tf.getModDate()

Anyway if someone does want to run this code you will require the
Terminal.jar to be installed in this folder

C:\j2sdk1.4.2_04\jre\lib\ext

or %JAVAHOME%\jre\lib

located here

http://www.reynolddemarcojr.com/Terminal.jar

and these files located here which will be in the same folder (not
JAVAHOME)

http://www.reynolddemarcojr.com/TextFile.java
http://www.reynolddemarcojr.com/Directory.java

So the output is this so far:

[Ljava.lang.String;@e5855a
2
TextFile@95fd19
TextFile@11b9fb1
file:

Process Directory finished

The main does reveal two files in the directory in two places but
when asked for the names and other information I am getting nothing
but what you see here.

Here is the whole program. If anyone can spot a few errors or bugs
please point them out. I will have to continue troubleshooting this
program until I get the desired output. The desired output is found
just above the main in doc comments and is called unit testing.

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on TreeMaps, Collections, Arrays... Or get search suggestion and latest updates.




Tagged: