CodePudding user response:
You can handle the exception, or try catch or throw up,
CodePudding user response:
Try catch and out the other wrong
CodePudding user response:
, the public static void main (String args []) this line to the public static void main (String args []) throws IOException, or will the int I=System. In the read (); This line is changed to: try {int I=System. In the read (); } the catch (IOException e) {}
CodePudding user response:
The
refer to the original poster KID6200 response: Honestly to write, you write that the input is a byte stream, even if handling abnormal answer also has a problem, Public static void main (String [] args) { //TODO Auto - generated method stub Scanner sc=new Scanner(System.in); Int I=sc. NextInt (); System. The out. Println (" I="+ I); } CodePudding user response:
reference ch_cyq reply: 3/f , the public static void main (String args []) this line to the public static void main (String args []) throws IOException, or will the int I=System. In the read (); This line is changed to: try {int I=System. In the read (); } the catch (IOException e) {} Changed the try catch it yesterday, then the following out wrong CodePudding user response:
The reference 4 floor qq_39936465 reply: Quote: refer to the original poster KID6200 response: Honestly to write, you write that the input is a byte stream, even if handling abnormal answer also has a problem, Public static void main (String [] args) { //TODO Auto - generated method stub Scanner sc=new Scanner(System.in); Int I=sc. NextInt (); System. The out. Println (" I="+ I); } The new semester began to learn Java, our teacher gave is in the read can tell me how to relief of the right CodePudding user response:
refer to 6th floor KID6200 response: the new semester began to learn Java, our teacher gave in. Read: could you tell me how the relief of the In the read () generally used to read a character Ublic static void main (String [] args) { //TODO Auto - generated method stub Try { Char I=(char) System. In the read (); System.out.println(i); } the catch (IOException e) { //TODO Auto - generated the catch block, e.printStackTrace(); } } CodePudding user response:
reference 5 floor KID6200 reply: Quote: refer to the third floor ch_cyq response: , the public static void main (String args []) this line to the public static void main (String args []) throws IOException, or will the int I=System. In the read (); This line is changed to: try {int I=System. In the read (); } the catch (IOException e) {} Changed the try catch it yesterday, then the following out wrong Because you have put out that package together in, lead to variable I scope out of the question, this really should be directly ask your teacher, answer with high efficiency