Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in my code:

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Error in my code:
<pre>
class Excep14
{
public static void main(String arr[])
{
int l = arr.length ;
FileNotFoundException fe = new FileNotFoundException("hello");
try
{
throw fe;
}
catch(FileNotFoundException e)
{
System.out.println(e.getMessage());
//throw e ;
}
finally
{
System.out.println("outer finally");
}
}
}
</pre>
[This message has been edited by maha anna (edited April 07, 2000).]
 
Jane Rozen
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
psethura, before somebody else starts analyzing your code , could you first try to tell us (and yourself) STEP BY STEP what you are trying to do here. You may as well find the right answer.
This is what I usually ask my students to do... it works!
 
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
psethura,
I request all , any time a qstn is posted please don't post like this. Clearly say what do you think and why, and what do you want. People will be more interested and easy for us also to answer quickly.
regds
maha anna
 
Kondal Rao
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Psethura,
I agree with Jane and Maha. But, I tried cut pasting your code and compiling. Then the compiler shouted saying that it doesn�t know what is FileNotFoundException. If you want to throw this exception, you need to import java.io.* package.
Once you do this, your program compiles and runs. But I am not 100% sure that this is your problem.
Regards,
Kondal.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic