• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

file input... please help

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about:

 
catherine matthews
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i still cant get the ouput...
It compiles...
Is there anything wrong, do i miss any declarations.....?
 
Tom Sullivan
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I usually write it as follows:


[ July 12, 2006: Message edited by: Tom Sullivan ]
 
catherine matthews
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is still the same....
No output.....
I just cant identify my mistake...
please help....
 
catherine matthews
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic