Exception handling and static (essays purely personal study concluded, I hope the passing of a friend can point out my mistakes, help me better progress, thanks)

The basic abnormality use, try {} catch () {} statement to achieve these two

java system errors can be automatically thrown in the catch () parentheses

Exception error using the received root class of all errors.

C ++, you need to manually throw an exception, c ++ and java in use

throw hand throw an exception, but need to throw an exception in java using new types

c ++ can customize any type of abnormality, and the catch (...) received

All exceptions thrown, java custom exception class to write an exception

This class inherits the exception as long as he is an anomaly,

java there throws, after the method name () plus throws exception

final java there, the final try {} catch () {} final {}, using the final processing

Code block into a try will be performed after in any case.

java in static Static:

Use static modification of member properties and methods are not owned by all objects, all classified

Use the class name attribute or method name to call

Using fast static modification code automatically executed when the class is loaded,

static modification of the properties, methods, codes fast only loaded once.

In C ++ static at present there is no contact with future projects to try practice

Guess you like

Origin www.cnblogs.com/deemohans/p/11706894.html