gudii9
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("Pausin g");
din.readChar();
System.out.println("Contin uing");
this.amethod();
return true;
}catch(IOException ioe) {}
finally{
System.out.println("finall y");
}
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.
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("Pausin
din.readChar();
System.out.println("Contin
this.amethod();
return true;
}catch(IOException ioe) {}
finally{
System.out.println("finall
}
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.
It prints "Pausing" and then blocks at
din.readChar();
until you provide input.
After it reads your input,
it prints "Continue"
din.readChar();
until you provide input.
After it reads your input,
it prints "Continue"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>I was trying to understand the output.
There isn't any output - for the reasons given by msk_apk
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 :)
you need to enter input into the eclipse console