• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

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 ]
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic