Two Laptop Bag
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Error in my code: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Error in my code:" Watch "Error in my code:" New topic

Error in my code:

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944

Error in my code:
class Excep14
public static void main(String arr[])
int l = arr.length ;
FileNotFoundException fe = new FileNotFoundException("hello");
throw fe;
catch(FileNotFoundException e)
//throw e ;
System.out.println("outer finally");
[This message has been edited by maha anna (edited April 07, 2000).]
Jane Rozen
Ranch Hand

Joined: Feb 12, 2000
Posts: 53
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

Joined: Jan 31, 2000
Posts: 1467
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.
maha anna
Kondal Rao

Joined: Apr 05, 2000
Posts: 18
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* package.
Once you do this, your program compiles and runs. But I am not 100% sure that this is your problem.
I agree. Here's the link:
subject: Error in my code:
It's not a secret anymore!