Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

exception example

import java.io.*;
class Base{
public static void amethod()throws FileNotFoundException{}
}



public class ExcepDemo extends Base{
public static void main(String argv[]){
       ExcepDemo e = new ExcepDemo();
}

public static void amethod(int i)throws IOException{}
private boolean ExcepDemo(){
 try{
    DataInputStream din = new DataInputStream(System.in);
    System.out.println("Pausing");
    din.readChar();
    System.out.println("Continuing");
    this.amethod();
    return true;
    }catch(IOException ioe) {}
    finally{
    System.out.println("finally");
    }
    return false;
  }

}


I was trying above example from link
http://www.jchq.net/certkey/0203certkey.htm
did not understand output while running in eclipse ide.

I was trying to understand the output. Any links, ideas, resources,sample code highly appreciated. thanks in advance.
Avatar of Mick Barry
Mick Barry
Flag of Australia image

its waiting for you input
you need to enter input into the eclipse console
It prints "Pausing" and then blocks at
din.readChar();

until you provide input.
After it reads your input,
it prints "Continue"

ASKER CERTIFIED SOLUTION
Avatar of msk_apk
msk_apk
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>I was trying to understand the output.

There isn't any output - for the reasons given by msk_apk
gudii9, you accepted the wrong answer. The correct answer is given at http:#35237879
Would you like me to point you at a pile of other questions where the same occurs :)