• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

file input... please help  RSS feed

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
How about:

 
catherine matthews
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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 ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!