{"@attributes":{"version":"2.0"},"channel":{"title":"JAVA on \u95f2\u6563\u5de5\u7a0b\u5e08\u7b14\u8bb0","link":"https:\/\/open-native.com\/tags\/java\/","description":"Recent content in JAVA on \u95f2\u6563\u5de5\u7a0b\u5e08\u7b14\u8bb0","generator":"Hugo -- gohugo.io","language":"zh-cn","lastBuildDate":"Wed, 20 Sep 2023 00:24:55 +0800","item":[{"title":"\u5173\u4e8e\u7c7b\u6301\u6709\u9759\u6001\u53d8\u91cf\u800c\u5f15\u53d1\u7684\u95ee\u9898\u6392\u67e5","link":"https:\/\/open-native.com\/article\/static-property-java\/","pubDate":"Wed, 20 Sep 2023 00:24:55 +0800","guid":"https:\/\/open-native.com\/article\/static-property-java\/","description":"\u95ee\u9898\u63cf\u8ff0 \u95f2\u8bdd\u5c11\u53d9\uff0c\u5148\u4e0a\u4ee3\u7801\u3002\npublic function main() { Util util = new Util(); util.print(); } public class Util { public static provider = new Provider(); public Util() { # do sth } public void print() { # print sth } } public function Provider() { public Provider() { loadData(); } private void loadData() { # load data } } \u5927\u6982\u4f7f\u7528\u903b\u8f91\u662f\u8fd9\u6837\uff0c\u5728\u8c03\u7528\u5165\u53e3\uff0c\u5b9e\u4f8b\u5316Util\u5bf9\u8c61\u5e76\u8c03\u7528\u4ed6\u7684print\u65b9\u6cd5\u3002 \u8fd9\u4e2a\u65f6\u5019\uff0c\u83b7\u53d6\u5230\u4e86\u4e00\u4e2aruntime exception\uff1aclass Util not defined\u3002\n\u7c7b\u660e\u660e\u5c31\u6446\u5728\u90a3\u91cc\uff0c\u4e3a\u4ec0\u4e48\u4f1a\u62a5\u5f02\u5e38\u5462\uff1f \u5927\u5bb6\u5982\u679c\u4e86\u89e3\u4e86\u7c7b\u9759\u6001\u6210\u5458\u53d8\u91cf\u7684\u521d\u59cb\u5316\u8fc7\u7a0b\uff0c\u5c31\u4e00\u773c\u770b\u51fa\u6765\u95ee\u9898\u3002\n\u9996\u5148\uff0cprovider\u662f\u5728Util\u7c7b\u88ab\u52a0\u8f7d\u7684\u65f6\u5019\u521d\u59cb\u5316\u7684\uff0c\u8981\u65e9\u4e8eUtil\u7684\u5b9e\u4f8b\u5316\u3002\n\u5176\u6b21\uff0c\u5982\u679cprovider\u521d\u59cb\u5316\u5931\u8d25\uff0c\u4f1a\u5bfc\u81f4Util\u7c7b\u52a0\u8f7d\u5931\u8d25\uff0c\u5728\u5b9e\u4f8b\u5316\u7684\u65f6\u5019\u5c31\u4f1a\u629b\u5f02\u5e38\u3002\n\u95ee\u9898\u7684\u76f4\u63a5\u539f\u56e0\u662f\u5728Provider\u7684\u6784\u9020\u8fc7\u7a0b\uff0c\u7531\u4e8e\u6784\u9020\u51fd\u6570\u6267\u884c\u4e86loadData\u7684\u52a8\u4f5c\uff0c\u8fd9\u91cc\u5c31\u5b58\u5728\u4e00\u4e9b\u4e0d\u786e\u5b9a\u56e0\u7d20\uff0c\u4f1a\u5bfc\u81f4\u9519\u8bef\u7684\u53d1\u751f\uff0c\u4ece\u800c\u5f71\u54cd\u5230\u4e86Util\u7684\u52a0\u8f7d\u3002\n\u6539\u8fdb\u601d\u8def \u7cbe\u7b80\u7c7b\u521d\u59cb\u5316\u7684\u8fc7\u7a0b\uff0c\u4f18\u5148\u4fdd\u8bc1\u5bf9\u8c61\u80fd\u5b9e\u4f8b\u5316\u6210\u529f\uff0c\u4ece\u800c\u518d\u6267\u884c\u6570\u636e\u52a0\u8f7d\u7684\u903b\u8f91\u3002\u53ef\u4ee5\u5229\u7528Spring\u7684PostConstruct\u6ce8\u89e3\u6765\u5b9e\u73b0\u5b9e\u4f8b\u5316\u548c\u6570\u636e\u52a0\u8f7d\u52a8\u4f5c\u7684\u5206\u79bb\u3002"},{"title":"java\u5305\u88c5\u7c7b\u578b","link":"https:\/\/open-native.com\/java\/box-type\/","pubDate":"Wed, 02 Aug 2023 23:36:26 +0800","guid":"https:\/\/open-native.com\/java\/box-type\/","description":"Java\u5305\u88c5\u7c7b\u578b\uff08\u4e5f\u79f0\u4e3a\u88c5\u7bb1\u7c7b\u578b\uff09\u662f\u4e3a\u4e86\u89e3\u51b3\u57fa\u672c\u6570\u636e\u7c7b\u578b\u4e0d\u80fd\u76f4\u63a5\u53c2\u4e0e\u9762\u5411\u5bf9\u8c61\u7684\u7279\u6027\uff0c\u4f8b\u5982\u4f7f\u7528\u6cdb\u578b\u3001\u96c6\u5408\u7b49\u3002\u7136\u800c\uff0c\u7531\u4e8e\u88c5\u7bb1\u7c7b\u578b\u5728\u5e95\u5c42\u662f\u901a\u8fc7\u5bf9\u8c61\u5305\u88c5\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff0c\u56e0\u6b64\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6027\u80fd\u95ee\u9898\uff0c\u5c24\u5176\u662f\u5728\u9891\u7e41\u7684\u88c5\u7bb1\u548c\u62c6\u7bb1\u64cd\u4f5c\u4e2d\u3002\n\u5982\u679c\u5728\u6027\u80fd\u654f\u611f\u7684\u4ee3\u7801\u4e2d\u4f7f\u7528\u5305\u88c5\u7c7b\u578b\uff0c\u53ef\u4ee5\u8003\u8651\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\u6765\u63d0\u9ad8\u6027\u80fd\uff1a\n\u4f7f\u7528\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff1a\u4f18\u5148\u4f7f\u7528\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff08\u5982int\u3001double\u7b49\uff09\u800c\u4e0d\u662f\u88c5\u7bb1\u7c7b\u578b\uff08\u5982Integer\u3001Double\u7b49\uff09\uff0c\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u88c5\u7bb1\u548c\u62c6\u7bb1\u64cd\u4f5c\u7684\u5f00\u9500\u3002 \u4f7f\u7528valueOf()\u65b9\u6cd5\uff1a\u5bf9\u4e8e\u88c5\u7bb1\u64cd\u4f5c\uff0c\u53ef\u4ee5\u4f7f\u7528valueOf()\u65b9\u6cd5\u6765\u83b7\u53d6\u5305\u88c5\u5bf9\u8c61\uff0c\u800c\u4e0d\u662f\u4f7f\u7528\u6784\u9020\u51fd\u6570\u3002valueOf()\u65b9\u6cd5\u5185\u90e8\u53ef\u80fd\u4f1a\u4f7f\u7528\u7f13\u5b58\uff0c\u4ece\u800c\u907f\u514d\u521b\u5efa\u4e0d\u5fc5\u8981\u7684\u65b0\u5bf9\u8c61\u3002 \u4f8b\u5982\uff1a Integer num = Integer.valueOf(42); \/\/ \u4f7f\u7528valueOf()\u65b9\u6cd5 \u4f7f\u7528\u7f13\u5b58\uff1a\u5bf9\u4e8e\u5c0f\u8303\u56f4\u7684\u6574\u6570\u6216\u5e38\u7528\u7684\u6d6e\u70b9\u6570\uff0cJava\u5728\u88c5\u7bb1\u64cd\u4f5c\u65f6\u4f1a\u8fdb\u884c\u7f13\u5b58\uff0c\u56e0\u6b64\u5728\u8fd9\u4e9b\u503c\u7684\u88c5\u7bb1\u548c\u62c6\u7bb1\u64cd\u4f5c\u4e0a\u4f1a\u66f4\u5feb\u3002 \u4f8b\u5982\uff1a Integer num1 = 42; \/\/ \u81ea\u52a8\u88c5\u7bb1\uff0c\u4f7f\u7528\u7f13\u5b58 int num2 = num1; \/\/ \u81ea\u52a8\u62c6\u7bb1 \u907f\u514d\u9891\u7e41\u88c5\u7bb1\u548c\u62c6\u7bb1\uff1a\u5728\u5faa\u73af\u6216\u9ad8\u9891\u64cd\u4f5c\u4e2d\uff0c\u5c3d\u91cf\u907f\u514d\u9891\u7e41\u5730\u8fdb\u884c\u88c5\u7bb1\u548c\u62c6\u7bb1\u64cd\u4f5c\uff0c\u53ef\u4ee5\u5c06\u57fa\u672c\u6570\u636e\u7c7b\u578b\u653e\u5165\u96c6\u5408\u6216\u6570\u7ec4\u4e2d\uff0c\u800c\u4e0d\u662f\u4f7f\u7528\u88c5\u7bb1\u7c7b\u578b\u7684\u96c6\u5408\u3002 \u4f7f\u7528Java 8\u7684Optional\u7c7b\uff1a\u5bf9\u4e8e\u53ef\u80fd\u4e3anull\u7684\u503c\uff0c\u53ef\u4ee5\u4f7f\u7528Java 8\u4e2d\u7684Optional\u7c7b\u6765\u5904\u7406\uff0c\u800c\u4e0d\u662f\u4f7f\u7528\u53ef\u80fd\u4f1a\u5f15\u8d77\u88c5\u7bb1\u7684\u88c5\u7bb1\u7c7b\u578b\u3002 \u4f8b\u5982\uff1a\nOptional&lt;Integer&gt; optionalNum = Optional.ofNullable(someValue); \/\/ \u4f7f\u7528Optional\u7c7b \u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\uff1a\u6709\u4e9b\u7b2c\u4e09\u65b9\u5e93\u4e13\u95e8\u9488\u5bf9\u6027\u80fd\u8fdb\u884c\u4e86\u4f18\u5316\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u8fd9\u4e9b\u5e93\u6765\u5904\u7406\u7279\u5b9a\u7684\u6027\u80fd\u95ee\u9898\u3002 \u603b\u7684\u6765\u8bf4\uff0c\u5728\u6027\u80fd\u654f\u611f\u7684\u4ee3\u7801\u4e2d\uff0c\u5c3d\u91cf\u51cf\u5c11\u88c5\u7bb1\u548c\u62c6\u7bb1\u7684\u6b21\u6570\uff0c\u4f18\u5148\u4f7f\u7528\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff0c\u5e76\u5408\u7406\u4f7f\u7528\u7f13\u5b58\u548c\u7b2c\u4e09\u65b9\u5e93\u6765\u63d0\u9ad8\u6027\u80fd\u3002\u5728\u5176\u4ed6\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528\u88c5\u7bb1\u7c7b\u578b\u53ef\u4ee5\u5e26\u6765\u66f4\u597d\u7684\u53ef\u8bfb\u6027\u548c\u7075\u6d3b\u6027\u3002\u4f18\u5316\u6027\u80fd\u65f6\u5e94\u5148\u8fdb\u884c\u6027\u80fd\u6d4b\u8bd5\uff0c\u786e\u4fdd\u4f18\u5316\u65b9\u6848\u771f\u6b63\u5e26\u6765\u4e86\u5b9e\u8d28\u7684\u6027\u80fd\u63d0\u5347\u3002"},{"title":"\u5404\u79cd\u8bbe\u8ba1\u6a21\u5f0f\u5982\u4f55\u7528java\u4ee3\u7801\u4f53\u73b0\uff1f","link":"https:\/\/open-native.com\/java\/design-pattern\/","pubDate":"Mon, 29 May 2023 11:36:26 +0800","guid":"https:\/\/open-native.com\/java\/design-pattern\/","description":"<h3 id=\"\u8bbe\u8ba1\u539f\u5219\">\u8bbe\u8ba1\u539f\u5219<\/h3>\n<ul>\n<li>\u591a\u7528\u7ec4\u5408\u5c11\u7528\u7ee7\u627f\u3002<\/li>\n<li>\u627e\u51fa\u5e94\u7528\u4e2d\u53ef\u80fd\u9700\u8981\u53d8\u5316\u4e4b\u5904\uff0c\u628a\u4ed6\u4eec\u72ec\u7acb\u51fa\u6765\uff0c\u4e0d\u8981\u548c\u90a3\u4e9b\u4e0d\u9700\u8981\u53d8\u5316\u7684\u4ee3\u7801\u6df7\u5408\u5728\u4e00\u8d77\u3002<\/li>\n<li>\u9488\u5bf9\u63a5\u53e3\u7f16\u7a0b\uff0c\u800c\u4e0d\u662f\u9488\u5bf9\u5b9e\u73b0\u7f16\u7a0b\u3002<\/li>\n<li>\u4e3a\u4e86\u4ea4\u4e92\u5bf9\u8c61\u4e4b\u95f4\u7684\u677e\u8026\u5408\u8bbe\u8ba1\u800c\u52aa\u529b\u3002<\/li>\n<li>\u7c7b\u5e94\u8be5\u5bf9\u6269\u5c55\u5f00\u653e\uff0c\u5bf9\u4fee\u6539\u5173\u95ed\u3002<\/li>\n<li>\u8981\u4f9d\u8d56\u62bd\u8c61\uff0c\u4e0d\u8981\u4f9d\u8d56\u5177\u4f53\u7c7b\u3002<\/li>\n<li>\u6700\u5c11\u77e5\u8bc6\u539f\u5219\uff1a\u53ea\u548c\u4f60\u7684\u5bc6\u53cb\u8c08\u8bdd\u3002\uff08\u76f8\u5f53\u4e8e\u7c7b\u95f4\u4ea4\u4e92\u9002\u5f53\u5c01\u88c5\uff0c\u51cf\u5c11\u8026\u5408\uff0c\u53ea\u8ba9\u5fc5\u8981\u90e8\u5206\u4ea4\u4e92\uff09<\/li>\n<\/ul>"},{"title":"How to setup Request timeout in Spring Boot REST API","link":"https:\/\/open-native.com\/java\/srpint-boot-timeout\/","pubDate":"Sun, 27 Jun 2021 18:23:19 +0800","guid":"https:\/\/open-native.com\/java\/srpint-boot-timeout\/","description":"<h4 id=\"timeout-using-transactional-annotation\">Timeout using @Transactional annotation<\/h4>\n<p>To set request timeout on database queries or calls by using Spring&rsquo;s @Transactional annotation. We may set the timeout attribute that it has. It has a default value of -1, which is the same as having no timeout at all.<\/p>\n<p>Let&rsquo;s say we have set this timeout to 50 seconds. An exception will be raised if the annotated method takes longer than this amount of time to execute. This approach is quite handy for time-consuming database searches or long-running SQL queries.<\/p>"},{"title":"Java \u9762\u8bd5\u9898\u6c47\u7f16 (\u4e03)","link":"https:\/\/open-native.com\/java\/interview-question-6\/","pubDate":"Sun, 27 Jun 2021 17:23:19 +0800","guid":"https:\/\/open-native.com\/java\/interview-question-6\/","description":"1. Multi threading 1.1 How do you create a thread In Java, there are two main ways to create a thread: by extending the Thread class, or by implementing the Runnable interface.\nExtending the Thread class:\nTo create a thread by extending the Thread class, you need to create a new class that extends Thread and overrides its run() method. The run() method contains the code that will be executed in the new thread."},{"title":"Java \u9762\u8bd5\u9898\u6c47\u7f16 (\u516d)","link":"https:\/\/open-native.com\/java\/interview-question-5\/","pubDate":"Sat, 26 Jun 2021 17:23:19 +0800","guid":"https:\/\/open-native.com\/java\/interview-question-5\/","description":"1. Collections 1.1 Why do we need collections in Java Collections in Java are a way to store and manipulate groups of objects. They are essential because they provide a way to manage data in a flexible and dynamic manner.\nHere are some of the key reasons why we need collections in Java:\nDynamic storage: Collections allow us to store and manipulate a large number of objects dynamically, without requiring us to know the exact number of objects in advance."},{"title":"Java \u9762\u8bd5\u9898\u6c47\u7f16 (\u4e94)","link":"https:\/\/open-native.com\/java\/interview-question-4\/","pubDate":"Fri, 25 Jun 2021 17:23:19 +0800","guid":"https:\/\/open-native.com\/java\/interview-question-4\/","description":"1. Advanced object oriented concepts 1.1 What is polymorphism Polymorphism is a fundamental concept in object-oriented programming (OOP) and refers to the ability of an object to take on multiple forms or behaviors. In Java, polymorphism allows an object to be treated as if it is of any type in its inheritance hierarchy.\nJava supports two types of polymorphism: static polymorphism (also known as method overloading) and dynamic polymorphism (also known as method overriding)."},{"title":"Java \u9762\u8bd5\u9898\u6c47\u7f16 (\u56db)","link":"https:\/\/open-native.com\/java\/interview-question-3\/","pubDate":"Thu, 24 Jun 2021 17:23:19 +0800","guid":"https:\/\/open-native.com\/java\/interview-question-3\/","description":"<h3 id=\"1-wrapper-classes\">1. Wrapper Classes<\/h3>\n<h4 id=\"11-what-are-wrapper-classes\">1.1 What are Wrapper classes<\/h4>\n<p>Wrapper classes are classes in object-oriented programming that are used to wrap or encapsulate primitive data types so that they can be treated as objects. In Java, for example, there are several wrapper classes such as Integer, Double, and Boolean that correspond to the primitive data types int, double, and boolean, respectively.<\/p>\n<p>Wrapper classes provide a way to represent primitive data types as objects, which allows them to be used in situations where objects are required, such as in collections or as method arguments. They also provide additional functionality, such as methods for converting between the wrapped value and other data types.<\/p>"},{"title":"8 Object-Oriented Design Principle and pattern","link":"https:\/\/open-native.com\/java\/8-oop-design-principle\/","pubDate":"Thu, 24 Jun 2021 16:23:19 +0800","guid":"https:\/\/open-native.com\/java\/8-oop-design-principle\/","description":"<h4 id=\"1-what-problem-is-solved-by-the-strategy-pattern-in-java\">1. What problem is solved by the Strategy pattern in Java?<\/h4>\n<p>Strategy pattern allows you to introduce a new algorithm or new strategy without changing the code which uses that algorithm. For example, the Collections.sort() method which sorts the list of the object uses the Strategy pattern to compare objects. Since every object uses a different comparison strategy you can compare various objects differently without changing the sort method.<\/p>"},{"title":"Java \u9762\u8bd5\u9898\u6c47\u7f16 (\u4e09)","link":"https:\/\/open-native.com\/java\/top-30-oop\/","pubDate":"Thu, 24 Jun 2021 16:23:19 +0800","guid":"https:\/\/open-native.com\/java\/top-30-oop\/","description":"<h4 id=\"1-what-is-method-overloading-in-oop-or-java\">1. What is method overloading in OOP or Java?<\/h4>\n<p>Method overloading in Java is an object-oriented programming concept that allows a programmer to declare two methods of the same name but with different method signatures, like a change in the argument list or a change in the type of argument.\nOriginal method :<\/p>\n<pre tabindex=\"0\"><code>public void  show(String message){\n      System.out.println(message);\n}\n<\/code><\/pre><p>Overloaded method: number of arguments is different:<\/p>"},{"title":"Java \u9762\u8bd5\u9898\u6c47\u7f16 (\u4e8c)","link":"https:\/\/open-native.com\/java\/interview-question-2\/","pubDate":"Mon, 21 Jun 2021 16:23:19 +0800","guid":"https:\/\/open-native.com\/java\/interview-question-2\/","description":"<h4 id=\"1-difference-between-string-stringbuffer-and-stringbuilder-in-java\">1. Difference between String, StringBuffer, and StringBuilder in Java?<\/h4>\n<p>String is immutable while both StringBuffer and StringBuilder are mutable, which means any change e.g. converting String to upper case or trimming white space will produce another instance rather than changing the same instance. In later two, StringBuffer is synchronized while StringBuilder is not, in fact, it&rsquo;s a ditto replacement of StringBuffer added in Java 1.5.<\/p>"},{"title":"Java \u9762\u8bd5\u9898\u6c47\u7f16 (\u4e00)","link":"https:\/\/open-native.com\/java\/interview-question\/","pubDate":"Fri, 18 Jun 2021 16:23:19 +0800","guid":"https:\/\/open-native.com\/java\/interview-question\/","description":"<p><strong>1. map\u91cc\uff0chashmap\u65e0\u5e8f\u7684\uff0c\u60f3\u8981\u6709\u5e8f\u7684\u8be5\u600e\u4e48\u529e\uff1f<\/strong><br>\nHashMap<\/p>\n<ul>\n<li>Map\u5b58\u50a8\u8fc7\u7a0b\uff1a\u8ba1\u7b97key\u7684hashCode\u503c\uff0c\u786e\u5b9a\u4f4d\u7f6e\uff1b\u5982\u679c\u4f4d\u7f6e\u4e0a\u6709\u5143\u7d20\uff0c\u7528equals\u5224\u65ad\u662f\u5426\u4e00\u81f4\uff0c\u5982\u679c\u4e00\u81f4\uff0c\u4e0d\u5b58\uff0c\u5982\u679c\u4e0d\u4e00\u81f4\uff0c\u904d\u5386\u4e0b\u4e00\u4e2a\u8282\u70b9\u7ee7\u7eed\u5224\u65adequals\u3002\u6ce8\uff1a\u6dfb\u52a0\u662f\u6dfb\u52a0\u5230\u94fe\u8868\u7684\u5c3e\u90e8\u3002\n\u52a0\u8f7d\u56e0\u5b50\uff08\u6269\u5bb9\u6761\u4ef6\uff09\uff1a\u9ed8\u8ba40.75\uff0c\u7a7a\u95f4\u5b58\u50a875%\u540e\u6269\u5bb9\u3002<\/li>\n<li>\u6269\u5bb9\uff1a\u5c06\u539f\u6765\u7684\u5143\u7d20\u91cd\u65b0\u8ba1\u7b97\u4f4d\u7f6e\u518d\u5b58\u5165\uff1b\u8ba1\u7b97\u9700\u8981\u65f6\u95f4\uff0c\u56e0\u6b64\u4e0d\u53ef\u4ee5\u9891\u7e41\u6269\u5bb9\uff0c\u6269\u5bb9\u662f\u6210\u500d\u7684\u3002<\/li>\n<li>HashMap\u6839\u636e\u952e\u53ef\u4ee5\u5f88\u5feb\u627e\u5230\u4ed6\u7684\u503c\uff0c\u56e0\u6b64\u5177\u6709\u5f88\u5feb\u7684\u8bbf\u95ee\u901f\u5ea6\uff0c\u904d\u5386\u65f6\uff0c\u53d6\u5f97\u6570\u636e\u7684\u987a\u5e8f\u662f\u5b8c\u5168\u968f\u673a\u7684\u3002<\/li>\n<li>HashMap\u4e0d\u652f\u6301\u7ebf\u7a0b\u7684\u540c\u6b65\uff0c\u5373\u4efb\u4e00\u65f6\u523b\u53ef\u4ee5\u6709\u591a\u4e2a\u7ebf\u7a0b\u540c\u65f6\u5199HashMap;\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6570\u636e\u7684\u4e0d\u4e00\u81f4\u3002<\/li>\n<li>HashMap\u7684\u952e\u53ea\u5141\u8bb8\u4e00\u6761\u4e3anull\uff0c\u503c\u53ef\u4ee5\u591a\u4e2a\u4e3anull<\/li>\n<\/ul>"},{"title":"Spring Bean \u7684\u751f\u547d\u5468\u671f","link":"https:\/\/open-native.com\/java\/bean-lifetime\/","pubDate":"Thu, 22 Apr 2021 11:36:26 +0800","guid":"https:\/\/open-native.com\/java\/bean-lifetime\/","description":"<h3 id=\"\u751f\u547d\u5468\u671f\u7684\u4e3b\u8981\u6d41\u7a0b\">\u751f\u547d\u5468\u671f\u7684\u4e3b\u8981\u6d41\u7a0b<\/h3>\n<p>Bean \u7684\u751f\u547d\u5468\u671f\u6982\u62ec\u8d77\u6765\u5c31\u662f 4 \u4e2a\u9636\u6bb5\uff1a<\/p>\n<ol>\n<li>\u5b9e\u4f8b\u5316\uff08Instantiation\uff09<\/li>\n<li>\u5c5e\u6027\u8d4b\u503c\uff08Populate\uff09<\/li>\n<li>\u521d\u59cb\u5316\uff08Initialization\uff09<\/li>\n<li>\u9500\u6bc1\uff08Destruction\uff09<\/li>\n<\/ol>"},{"title":"Java \u95ee\u9898\u6392\u67e5","link":"https:\/\/open-native.com\/java\/java-trouble-shoot\/","pubDate":"Mon, 10 Sep 2018 16:23:19 +0800","guid":"https:\/\/open-native.com\/java\/java-trouble-shoot\/","description":"<h3 id=\"\u8fd0\u884c\u53c2\u6570\">\u8fd0\u884c\u53c2\u6570<\/h3>\n<p>\u5173\u4e8ejava\u542f\u52a8\u53c2\u6570\u914d\u7f6e\uff0c\u5927\u5bb6\u53ef\u4ee5\u53c2\u9605\uff1a<a href=\"https:\/\/docs.oracle.com\/javase\/8\/docs\/technotes\/tools\/unix\/toc.html\">\u5b98\u65b9\u6587\u6863<\/a><\/p>\n<h4 id=\"\u67e5\u770bjvm\u53c2\u6570\">\u67e5\u770bJVM\u53c2\u6570<\/h4>\n<p>\u4f7f\u7528\u547d\u4ee4 <code>jps -l<\/code> \u67e5\u770b\u6240\u6709\u6b63\u5728\u8fd0\u884c\u7684Java\u7a0b\u5e8f\uff0c\u540c\u65f6\u663e\u793a\u542f\u52a8\u7c7b\u7c7b\u540d\uff0c\u83b7\u53d6\u5230PID<\/p>\n<pre tabindex=\"0\"><code>4706 org.apache.catalina.startup.Bootstrap\n5023 sun.tools.jps.Jps\n<\/code><\/pre>"}]}}