on

<div class="iteye-blog-content-contain" style="font-size: 14px">

   There are twenty-three Java design patterns, which are mainly divided into three types: creational patterns, structural patterns, and behavioral patterns;

Creation pattern: factory method pattern, abstract factory pattern, singleton pattern, builder pattern, prototype pattern;

Structural patterns: adapter pattern, decorator pattern, proxy pattern, appearance pattern, bridge pattern, combination pattern, Hengyuan pattern;

Behavioral patterns: Strategy pattern, Observer pattern, Iterative sub pattern, Chain of responsibility pattern, Command pattern, Memorandum pattern, State pattern, Visitor pattern, Mediator pattern, Interpreter pattern.

 There are two other categories: concurrent mode and thread pool mode

 

 The difference between throw and throws:

Throw is used in the method body to throw an actual exception object. After using throw, either use try catch to catch the exception, or use throws to declare the exception. Syntax: throw new exception class construct f method, throw new Exception().

throws is used at the method declaration to declare the type of exception that may occur in the method, which can be multiple exception types, used to force these exceptions to be handled when the method is called

</div>

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326611992&siteId=291194637