<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Java on My Blog</title>
    <link>http://localhost:1313/categories/java/</link>
    <description>Recent content from My Blog</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    
    <managingEditor>3453434429@qq.com (ArenBase)</managingEditor>
    <webMaster>3453434429@qq.com (ArenBase)</webMaster>
    
    <copyright>本博客所有文章除特别声明外，均采用 BY-NC-SA 许可协议。转载请注明出处！</copyright>
    
    <lastBuildDate>Mon, 22 Jun 2026 00:00:00 +0000</lastBuildDate>
    
    
    <atom:link href="http://localhost:1313/categories/java/index.xml" rel="self" type="application/rss&#43;xml" />
    

    
    

    <item>
      <title>JavaWeb环境配置</title>
      <link>http://localhost:1313/post/javaweb%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/</link>
      <pubDate>Mon, 22 Jun 2026 00:00:00 &#43;0000</pubDate>
      <author>3453434429@qq.com (ArenBase)</author>
      <guid>http://localhost:1313/post/javaweb%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/</guid>
      <description>
        <![CDATA[<h1>JavaWeb环境配置</h1><p>作者：ArenBase（3453434429@qq.com）</p>
        
          <h1 id="java-web-开发环境配置笔记基于-servlet--tomcat--thymeleaf">
<a class="header-anchor" href="#java-web-%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e9%85%8d%e7%bd%ae%e7%ac%94%e8%ae%b0%e5%9f%ba%e4%ba%8e-servlet--tomcat--thymeleaf"></a>
Java Web 开发环境配置笔记（基于 Servlet + Tomcat + Thymeleaf）
</h1><blockquote>
<p>本笔记整理自项目实战文档，涵盖 JDK、Tomcat、IDEA、MySQL 及各类依赖库的完整配置，适用于 Servlet + JSP + Thymeleaf + JDBC 的传统 Java Web 开发。</p>
        
        <hr><p>本文2026-06-22首发于<a href='http://localhost:1313/'>My Blog</a>，最后修改于2026-06-22</p>]]>
      </description>
      
        <category>Java</category><category>JavaWeb</category>
      
    </item>
    
    

    <item>
      <title>继承 Thread 类和实现 Runnable 接口的区别</title>
      <link>http://localhost:1313/post/%E7%BB%A7%E6%89%BF-thread-%E7%B1%BB%E5%92%8C%E5%AE%9E%E7%8E%B0-runnable-%E6%8E%A5%E5%8F%A3%E7%9A%84%E5%8C%BA%E5%88%AB/</link>
      <pubDate>Fri, 05 Jun 2026 00:00:00 &#43;0000</pubDate>
      <author>3453434429@qq.com (ArenBase)</author>
      <guid>http://localhost:1313/post/%E7%BB%A7%E6%89%BF-thread-%E7%B1%BB%E5%92%8C%E5%AE%9E%E7%8E%B0-runnable-%E6%8E%A5%E5%8F%A3%E7%9A%84%E5%8C%BA%E5%88%AB/</guid>
      <description>
        <![CDATA[<h1>继承 Thread 类和实现 Runnable 接口的区别</h1><p>作者：ArenBase（3453434429@qq.com）</p>
        
          <p>在 Java 中，<strong>继承 <code>Thread</code> 类</strong>和<strong>实现 <code>Runnable</code> 接口</strong>是两种经典的多线程实现方式。它们本质上都是通过 <code>Thread</code> 类来执行线程，但设计理念和适用场景有明显区别。</p>
<h2 id="核心区别总结">
<a class="header-anchor" href="#%e6%a0%b8%e5%bf%83%e5%8c%ba%e5%88%ab%e6%80%bb%e7%bb%93"></a>
核心区别总结
</h2><table>
  <thead>
      <tr>
          <th>对比维度</th>
          <th>继承 <code>Thread</code> 类</th>
          <th>实现 <code>Runnable</code> 接口</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>资源共享</strong></td>
          <td>较难实现（需要共享静态变量或外部对象）</td>
          <td>天然支持多个线程共享同一个 <code>Runnable</code> 实例</td>
      </tr>
      <tr>
          <td><strong>灵活性</strong></td>
          <td>低（Java单继承限制）</td>
          <td>高（可以继承其他类）</td>
      </tr>
      <tr>
          <td><strong>代码与逻辑分离</strong></td>
          <td>未分离（线程创建和任务代码耦合）</td>
          <td>已分离（线程和任务解耦）</td>
      </tr>
      <tr>
          <td><strong>线程池支持</strong></td>
          <td>不推荐使用（<code>Thread</code> 对象不能被重用）</td>
          <td>推荐使用（<code>Runnable</code> 或 <code>Callable</code> 提交给线程池）</td>
      </tr>
      <tr>
          <td><strong>适用场景</strong></td>
          <td>简单、临时、不需要共享数据的线程</td>
          <td>复杂、需要共享资源、或已有父类的场景</td>
      </tr>
  </tbody>
</table>
<h2 id="详细对比与示例">
<a class="header-anchor" href="#%e8%af%a6%e7%bb%86%e5%af%b9%e6%af%94%e4%b8%8e%e7%a4%ba%e4%be%8b"></a>
详细对比与示例
</h2><h3 id="1-资源共享能力">
<a class="header-anchor" href="#1-%e8%b5%84%e6%ba%90%e5%85%b1%e4%ba%ab%e8%83%bd%e5%8a%9b"></a>
1. 资源共享能力
</h3><p><strong>继承 <code>Thread</code> 类</strong>：每个线程对象拥有自己独立的成员变量副本，要共享数据通常需要 <code>static</code> 变量或传递公共对象。</p>
        
        <hr><p>本文2026-06-05首发于<a href='http://localhost:1313/'>My Blog</a>，最后修改于2026-06-05</p>]]>
      </description>
      
        <category>Java</category>
      
    </item>
    
    

    <item>
      <title>字符输出流与字节输出流实现文件复制</title>
      <link>http://localhost:1313/post/%E5%AD%97%E7%AC%A6%E8%BE%93%E5%87%BA%E6%B5%81%E4%B8%8E%E5%AD%97%E8%8A%82%E8%BE%93%E5%87%BA%E6%B5%81/</link>
      <pubDate>Tue, 26 May 2026 00:00:00 &#43;0000</pubDate>
      <author>3453434429@qq.com (ArenBase)</author>
      <guid>http://localhost:1313/post/%E5%AD%97%E7%AC%A6%E8%BE%93%E5%87%BA%E6%B5%81%E4%B8%8E%E5%AD%97%E8%8A%82%E8%BE%93%E5%87%BA%E6%B5%81/</guid>
      <description>
        <![CDATA[<h1>字符输出流与字节输出流实现文件复制</h1><p>作者：ArenBase（3453434429@qq.com）</p>
        
          <h1 id="java-io-流复制文件练习">
<a class="header-anchor" href="#java-io-%e6%b5%81%e5%a4%8d%e5%88%b6%e6%96%87%e4%bb%b6%e7%bb%83%e4%b9%a0"></a>
Java I/O 流复制文件练习
</h1><p>本练习演示了如何使用 <strong>字符缓冲流</strong> 和 <strong>字节缓冲流</strong> 实现文件的复制。其中 <code>BufferedReader</code> + <code>BufferedWriter</code> 适合复制<strong>文本文件</strong>，而 <code>BufferedInputStream</code> + <code>BufferedOutputStream</code> 可以复制<strong>任意类型</strong>的文件（图片、视频、可执行文件等）。</p>
        
        <hr><p>本文2026-05-26首发于<a href='http://localhost:1313/'>My Blog</a>，最后修改于2026-05-26</p>]]>
      </description>
      
        <category>Java</category>
      
    </item>
    
    

    <item>
      <title>Java反射概述</title>
      <link>http://localhost:1313/post/java%E5%8F%8D%E5%B0%84%E6%A6%82%E8%BF%B0/</link>
      <pubDate>Sun, 24 May 2026 00:00:00 &#43;0000</pubDate>
      <author>3453434429@qq.com (ArenBase)</author>
      <guid>http://localhost:1313/post/java%E5%8F%8D%E5%B0%84%E6%A6%82%E8%BF%B0/</guid>
      <description>
        <![CDATA[<h1>Java反射概述</h1><p>作者：ArenBase（3453434429@qq.com）</p>
        
          <p>Java的反射机制是Java语言提供的一种强大特性，它允许程序在<strong>运行时</strong>检查和操作类、接口、字段和方法，而无需在编译时知道它们的具体名称。你可以把它理解为一种“自省”能力——程序可以审视自己，甚至修改自己的内部状态。</p>
        
        <hr><p>本文2026-05-24首发于<a href='http://localhost:1313/'>My Blog</a>，最后修改于2026-05-24</p>]]>
      </description>
      
        <category>Java</category>
      
    </item>
    
    

    <item>
      <title>匿名内部类使用场景</title>
      <link>http://localhost:1313/post/%E5%8C%BF%E5%90%8D%E5%86%85%E9%83%A8%E7%B1%BB%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF/</link>
      <pubDate>Sat, 23 May 2026 00:00:00 &#43;0000</pubDate>
      <author>3453434429@qq.com (ArenBase)</author>
      <guid>http://localhost:1313/post/%E5%8C%BF%E5%90%8D%E5%86%85%E9%83%A8%E7%B1%BB%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF/</guid>
      <description>
        <![CDATA[<h1>匿名内部类使用场景</h1><p>作者：ArenBase（3453434429@qq.com）</p>
        
          <h1 id="匿名内部类使用场景笔记附练习成果">
<a class="header-anchor" href="#%e5%8c%bf%e5%90%8d%e5%86%85%e9%83%a8%e7%b1%bb%e4%bd%bf%e7%94%a8%e5%9c%ba%e6%99%af%e7%ac%94%e8%ae%b0%e9%99%84%e7%bb%83%e4%b9%a0%e6%88%90%e6%9e%9c"></a>
匿名内部类使用场景笔记（附练习成果）
</h1><h2 id="一什么是匿名内部类">
<a class="header-anchor" href="#%e4%b8%80%e4%bb%80%e4%b9%88%e6%98%af%e5%8c%bf%e5%90%8d%e5%86%85%e9%83%a8%e7%b1%bb"></a>
一、什么是匿名内部类？
</h2><p>匿名内部类是没有显式类名的内部类，它<strong>在定义的同时立即实例化</strong>，通常用于<strong>一次性使用</strong>的场景。语法格式：</p>
        
        <hr><p>本文2026-05-23首发于<a href='http://localhost:1313/'>My Blog</a>，最后修改于2026-05-23</p>]]>
      </description>
      
        <category>Java</category>
      
    </item>
    
  </channel>
</rss>
