Program Console does not open automatically for Eclipse debugging

Source: Internet
Author: User

For this program, at the beginning of the time, did not knock on the 22,29,33 line of the print statement, when debugging does not automatically open the console, so has been suspected that the code may be wrong. So you can open it manually, but if you knock on the code, the system will automatically bounce off the console.

1 /**2 * Find out the maximum value3  */4 ImportJava.io.BufferedReader;//Import all classes in the IO package for input and output in the Java system5 Importjava.io.IOException;6 ImportJava.io.InputStreamReader;7 8  Public classCHAP01 {9      Public intFindmax (int[] a) {//A method definition that finds the maximum value from the shaping array aTen         intX=A[0];//assigns the value of the first element in array a a[0] to x as the initial One          for(intI= 1;i<a.length; i++) {//finding a in the array by loop order is the maximum value of the element A             if(a[i]>x) { -x=A[i]; -             } the         } -         returnX//returns the maximum value of the element saved in X -     } -      Public Static voidMain (string[] args)throwsIOException {//defines the main method, which throws an exception when the keyboard data is read incorrectly +                  -         int[] A=New int[5];//declaring and creating an integer group of num length 5 +CHAP01 array =NewCHAP01 ();//declaring and creating an Chap01 object array ASystem.out.println ("Please enter data:"); at          for(intI =0;i<a.length;i++) {//enter data from the keyboard to array a, with each integer ending with a enter key -BufferedReader keyb=NewBufferedReader (NewInputStreamReader (system.in)); -String line = Keyb.readline ();//reads a line of string from the keyboard as an integer -A[i]=integer.parseint (line);//get an integer from the line string and assign it to the A[i] element -         } -         intmax = Array.findmax (a);//use Max to save the largest value in an array inSystem.out.println ("The number you entered is:"); -          for(inti=0;i<a.length;i++) {//output The value of each element in array a sequentially toSystem.out.print (a[i]+ "\ T");  +         } -System.out.println ("\ n" + "Maximum value:" +max);//The value of the output max after execution, which is the maximum value in array a the     } *}

There was no error, and the result was

Program Console does not open automatically for Eclipse debugging

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.