gudii9
asked on
exception handling
public class Try{
import java.io.*;
public static void main(String argv[]){
Try t = new Try();
t.go();
}//End of main
public void go(){
try{
InputStreamReader isr = new InputStreamReader(System.i n);
BufferedReader br = new BufferedReader(isr);
br.readLine();
} catch(Exception e){
/*Not doing anything when exception occurs*/
} //End of try
System.out.println("Contin uing");
}//End of go
}
I was trying above example from link
http://www.jchq.net/certkey/0203certkey.htm
did not get any output.
I was trying to understand the output. Any links, ideas, resources,sample code highly appreciated. thanks in advance.
import java.io.*;
public static void main(String argv[]){
Try t = new Try();
t.go();
}//End of main
public void go(){
try{
InputStreamReader isr = new InputStreamReader(System.i
BufferedReader br = new BufferedReader(isr);
br.readLine();
} catch(Exception e){
/*Not doing anything when exception occurs*/
} //End of try
System.out.println("Contin
}//End of go
}
I was trying above example from link
http://www.jchq.net/certkey/0203certkey.htm
did not get any output.
I was trying to understand the output. Any links, ideas, resources,sample code highly appreciated. thanks in advance.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Maybe you ddn't get any output, as it was waiting for your input from keyboard?
import java.io.*;
is normally on the very top not after class definition
When I tyoes ttt it responed Contniuing...
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Try{
public static void main(String argv[]){
Try t = new Try();
t.go();
}//End of main
public void go(){
try{
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
br.readLine();
} catch(Exception e){
/*Not doing anything when exception occurs*/
} //End of try
System.out.println("Continuing");
}//End of go
}
ttt
Continuing
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
>>>a. you typed ttt
just type ttt in eclipse console and then click enter right. please advise
just type ttt in eclipse console and then click enter right. please advise
> just type ttt in eclipse console and then click enter right. please advise
its irrelevant what you type, its just waiting for you to hit enter as I explained in my furst comment
its irrelevant what you type, its just waiting for you to hit enter as I explained in my furst comment
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.