The eclipse has been downloaded for a long time, and in addition to JFrame and BigInteger, there has been no use of other Java features. On the occasion of Android, learn Java fundamentals by the way.
First, try, catch, finally
This set of keywords is useful when debugging a project, because even if the program has an error, it does not end the program directly, but instead uses the catch to output the error message (or location). It should be said to be more useful.
Baidu a bit, found in C + + actually have try and catch keyword .... In vain I learned C + + has been 3 years, the results even the basis of the key words have not touched the familiar .... It was a shame. However, there is no finally keyword in C + +.
This set of keywords runs roughly: If a program executed in a try executes correctly, the catch is not executed, and if a program executing in a try has an error, the code in the try is immediately stopped, and the code in the catch is run instead. And finally it's all going to run.
Interestingly, the code written after the code is also running. (I don't know what's the use of finally ...) )
1 Try2 {3 inti = 1/1;4System.out.println ("Try");5 }6 Catch(Exception e)7 {8System.out.println ("Catch");9 }Ten finally One { ASystem.out.println ("Finally"); - } -System.out.println ("End");View Code
Java Learning Notes