my dog learned polymorphism*
The moose likes Beginning Java and the fly likes file input... please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "file input... please help" Watch "file input... please help" New topic
Author

file input... please help

catherine matthews
Ranch Hand

Joined: Jan 22, 2006
Posts: 78
I need to get superclass filename, and get the content of the super class file//


please help

[ July 12, 2006: Message edited by: catherine matthews ]
[ July 12, 2006: Message edited by: catherine matthews ]
Tom Sullivan
Ranch Hand

Joined: Dec 20, 2005
Posts: 72
How about:

catherine matthews
Ranch Hand

Joined: Jan 22, 2006
Posts: 78
i still cant get the ouput...
It compiles...
Is there anything wrong, do i miss any declarations.....?
Tom Sullivan
Ranch Hand

Joined: Dec 20, 2005
Posts: 72
I usually write it as follows:


[ July 12, 2006: Message edited by: Tom Sullivan ]
catherine matthews
Ranch Hand

Joined: Jan 22, 2006
Posts: 78
It is still the same....
No output.....
I just cant identify my mistake...
please help....
catherine matthews
Ranch Hand

Joined: Jan 22, 2006
Posts: 78
thanks Mr.tom'

i just modified i bit...
the sup.getname() just gets me the name of the class...
i suppose we would need to give .java at the end so...
[code]
String lined = "";
Class sup = cls.getSuperclass();
if(!(sup.getName().indexOf("java.lang.Object")>-1))
{
twoSuper = (sup.getName()+".java");
File fileSuper1 = new File (twoSuper);
try {
br1 = new BufferedReader (new FileReader(fileSuper1));
while ((lined = br1.readLine()) != null)
{

System.out.println(" the new file\t"+ lined + "\n");
}

} catch (IOException e){}
[\code]
[ July 12, 2006: Message edited by: catherine matthews ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: file input... please help