doc: Modified java.md (#96)

Co-authored-by: Pengcc <pcc_pengcc@163.com> 03cc3cf5c3
This commit is contained in:
jaywcjlove
2022-11-16 03:33:53 +00:00
parent 54543dd436
commit d61cb5433d
2 changed files with 2 additions and 5 deletions

View File

@ -42,7 +42,7 @@
<p>该备忘单是针对 Java 初学者的速成课程,有助于复习 Java 语言的基本语法。</p>
</div></header><div class="menu-tocs"><div class="menu-btn"><svg aria-hidden="true" fill="currentColor" height="1em" width="1em" viewBox="0 0 16 16" version="1.1" data-view-component="true">
<path fill-rule="evenodd" d="M2 4a1 1 0 100-2 1 1 0 000 2zm3.75-1.5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zM3 8a1 1 0 11-2 0 1 1 0 012 0zm-1 6a1 1 0 100-2 1 1 0 000 2z"></path>
</svg></div><div class="menu-modal"><a aria-hidden="true" class="leve2 tocs-link" href="#入门">入门</a><a aria-hidden="true" class="leve3 tocs-link" href="#hellojava">Hello.java</a><a aria-hidden="true" class="leve3 tocs-link" href="#变量-variables">变量 Variables</a><a aria-hidden="true" class="leve3 tocs-link" href="#原始数据类型">原始数据类型</a><a aria-hidden="true" class="leve3 tocs-link" href="#字符串-strings">字符串 Strings</a><a aria-hidden="true" class="leve3 tocs-link" href="#循环-loops">循环 Loops</a><a aria-hidden="true" class="leve3 tocs-link" href="#数组-arrays">数组 Arrays</a><a aria-hidden="true" class="leve3 tocs-link" href="#swap">Swap</a><a aria-hidden="true" class="leve3 tocs-link" href="#type-casting">Type Casting</a><a aria-hidden="true" class="leve3 tocs-link" href="#条件语句-conditionals">条件语句 Conditionals</a><a aria-hidden="true" class="leve3 tocs-link" href="#用户输入">用户输入</a><a aria-hidden="true" class="leve2 tocs-link" href="#java-字符串">Java 字符串</a><a aria-hidden="true" class="leve3 tocs-link" href="#基本的">基本的</a><a aria-hidden="true" class="leve3 tocs-link" href="#字符串连接">字符串连接</a><a aria-hidden="true" class="leve3 tocs-link" href="#字符串生成器">字符串生成器</a><a aria-hidden="true" class="leve3 tocs-link" href="#比较">比较</a><a aria-hidden="true" class="leve3 tocs-link" href="#操纵">操纵</a><a aria-hidden="true" class="leve3 tocs-link" href="#信息">信息</a><a aria-hidden="true" class="leve3 tocs-link" href="#不可变">不可变</a><a aria-hidden="true" class="leve2 tocs-link" href="#java-数组">Java 数组</a><a aria-hidden="true" class="leve3 tocs-link" href="#明-declare">明 Declare</a><a aria-hidden="true" class="leve3 tocs-link" href="#修改-modify">修改 Modify</a><a aria-hidden="true" class="leve3 tocs-link" href="#循环-读--写">循环 (读 &#x26; 写)</a><a aria-hidden="true" class="leve3 tocs-link" href="#loop-read">Loop (Read)</a><a aria-hidden="true" class="leve3 tocs-link" href="#multidimensional-arrays">Multidimensional Arrays</a><a aria-hidden="true" class="leve3 tocs-link" href="#sort">Sort</a><a aria-hidden="true" class="leve2 tocs-link" href="#java-条件语句">Java 条件语句</a><a aria-hidden="true" class="leve3 tocs-link" href="#运算符">运算符</a><a aria-hidden="true" class="leve3 tocs-link" href="#if-else">If else</a><a aria-hidden="true" class="leve3 tocs-link" href="#switch">Switch</a><a aria-hidden="true" class="leve3 tocs-link" href="#三元运算符">三元运算符</a><a aria-hidden="true" class="leve2 tocs-link" href="#java-循环">Java 循环</a><a aria-hidden="true" class="leve3 tocs-link" href="#for-循环">For 循环</a><a aria-hidden="true" class="leve3 tocs-link" href="#增强的-for-循环">增强的 For 循环</a><a aria-hidden="true" class="leve3 tocs-link" href="#while-循环">While 循环</a><a aria-hidden="true" class="leve3 tocs-link" href="#do-while-循环">Do While 循环</a><a aria-hidden="true" class="leve3 tocs-link" href="#继续声明">继续声明</a><a aria-hidden="true" class="leve3 tocs-link" href="#中断语句">中断语句</a><a aria-hidden="true" class="leve2 tocs-link" href="#java-框架搜集">Java 框架搜集</a><a aria-hidden="true" class="leve3 tocs-link" href="#java-搜集">Java 搜集</a><a aria-hidden="true" class="leve3 tocs-link" href="#arraylist">ArrayList</a><a aria-hidden="true" class="leve3 tocs-link" href="#hashmap">HashMap</a><a aria-hidden="true" class="leve3 tocs-link" href="#hashset">HashSet</a><a aria-hidden="true" class="leve3 tocs-link" href="#arraydeque">ArrayDeque</a><a aria-hidden="true" class="leve2 tocs-link" href="#杂项-misc">杂项 Misc</a><a aria-hidden="true" class="leve3 tocs-link" href="#访问修饰符">访问修饰符</a><a aria-hidden="true" class="leve3 tocs-link" href="#常用表达">常用表达</a><a aria-hidden="true" class="leve3 tocs-link" href="#注释-comment">注释 Comment</a><a aria-hidden="true" class="leve3 tocs-link" href="#关键字">关键字</a><a aria-hidden="true" class="leve3 tocs-link" href="#数学方法">数学方法</a><a aria-hidden="true" class="leve3 tocs-link" href="#trycatchfinally">Try/Catch/Finally</a><a aria-hidden="true" class="leve3 tocs-link" href="#util工具类">util工具类</a><a aria-hidden="true" class="leve2 tocs-link" href="#另见">另见</a></div></div><div class="h1wrap-body"><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="入门"><a aria-hidden="true" tabindex="-1" href="#入门"><span class="icon icon-link"></span></a>入门</h2><div class="wrap-body">
</svg></div><div class="menu-modal"><a aria-hidden="true" class="leve2 tocs-link" href="#入门">入门</a><a aria-hidden="true" class="leve3 tocs-link" href="#hellojava">Hello.java</a><a aria-hidden="true" class="leve3 tocs-link" href="#变量-variables">变量 Variables</a><a aria-hidden="true" class="leve3 tocs-link" href="#原始数据类型">原始数据类型</a><a aria-hidden="true" class="leve3 tocs-link" href="#字符串-strings">字符串 Strings</a><a aria-hidden="true" class="leve3 tocs-link" href="#循环-loops">循环 Loops</a><a aria-hidden="true" class="leve3 tocs-link" href="#数组-arrays">数组 Arrays</a><a aria-hidden="true" class="leve3 tocs-link" href="#swap">Swap</a><a aria-hidden="true" class="leve3 tocs-link" href="#type-casting">Type Casting</a><a aria-hidden="true" class="leve3 tocs-link" href="#条件语句-conditionals">条件语句 Conditionals</a><a aria-hidden="true" class="leve3 tocs-link" href="#用户输入">用户输入</a><a aria-hidden="true" class="leve2 tocs-link" href="#java-字符串">Java 字符串</a><a aria-hidden="true" class="leve3 tocs-link" href="#基本的">基本的</a><a aria-hidden="true" class="leve3 tocs-link" href="#字符串连接">字符串连接</a><a aria-hidden="true" class="leve3 tocs-link" href="#字符串生成器">字符串生成器</a><a aria-hidden="true" class="leve3 tocs-link" href="#比较">比较</a><a aria-hidden="true" class="leve3 tocs-link" href="#操纵">操纵</a><a aria-hidden="true" class="leve3 tocs-link" href="#信息">信息</a><a aria-hidden="true" class="leve3 tocs-link" href="#不可变">不可变</a><a aria-hidden="true" class="leve2 tocs-link" href="#java-数组">Java 数组</a><a aria-hidden="true" class="leve3 tocs-link" href="#明-declare">明 Declare</a><a aria-hidden="true" class="leve3 tocs-link" href="#修改-modify">修改 Modify</a><a aria-hidden="true" class="leve3 tocs-link" href="#循环-读--写">循环 (读 &#x26; 写)</a><a aria-hidden="true" class="leve3 tocs-link" href="#loop-read">Loop (Read)</a><a aria-hidden="true" class="leve3 tocs-link" href="#multidimensional-arrays">Multidimensional Arrays</a><a aria-hidden="true" class="leve3 tocs-link" href="#sort">Sort</a><a aria-hidden="true" class="leve2 tocs-link" href="#java-条件语句">Java 条件语句</a><a aria-hidden="true" class="leve3 tocs-link" href="#运算符">运算符</a><a aria-hidden="true" class="leve3 tocs-link" href="#if-else">If else</a><a aria-hidden="true" class="leve3 tocs-link" href="#switch">Switch</a><a aria-hidden="true" class="leve3 tocs-link" href="#三元运算符">三元运算符</a><a aria-hidden="true" class="leve2 tocs-link" href="#java-循环">Java 循环</a><a aria-hidden="true" class="leve3 tocs-link" href="#for-循环">For 循环</a><a aria-hidden="true" class="leve3 tocs-link" href="#增强的-for-循环">增强的 For 循环</a><a aria-hidden="true" class="leve3 tocs-link" href="#while-循环">While 循环</a><a aria-hidden="true" class="leve3 tocs-link" href="#do-while-循环">Do While 循环</a><a aria-hidden="true" class="leve3 tocs-link" href="#继续声明">继续声明</a><a aria-hidden="true" class="leve3 tocs-link" href="#中断语句">中断语句</a><a aria-hidden="true" class="leve2 tocs-link" href="#java-框架搜集">Java 框架搜集</a><a aria-hidden="true" class="leve3 tocs-link" href="#java-搜集">Java 搜集</a><a aria-hidden="true" class="leve3 tocs-link" href="#arraylist">ArrayList</a><a aria-hidden="true" class="leve3 tocs-link" href="#hashmap">HashMap</a><a aria-hidden="true" class="leve3 tocs-link" href="#hashset">HashSet</a><a aria-hidden="true" class="leve3 tocs-link" href="#arraydeque">ArrayDeque</a><a aria-hidden="true" class="leve2 tocs-link" href="#杂项-misc">杂项 Misc</a><a aria-hidden="true" class="leve3 tocs-link" href="#访问修饰符">访问修饰符</a><a aria-hidden="true" class="leve3 tocs-link" href="#常用表达">常用表达</a><a aria-hidden="true" class="leve3 tocs-link" href="#注释-comment">注释 Comment</a><a aria-hidden="true" class="leve3 tocs-link" href="#关键字">关键字</a><a aria-hidden="true" class="leve3 tocs-link" href="#数学方法">数学方法</a><a aria-hidden="true" class="leve3 tocs-link" href="#trycatchfinally">Try/Catch/Finally</a><a aria-hidden="true" class="leve3 tocs-link" href="#util工具类">util工具类</a><a aria-hidden="true" class="leve2 tocs-link" href="#另见">另见</a></div></div><div class="h1wrap-body"><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="入门"><a aria-hidden="true" tabindex="-1" href="#入门"><span class="icon icon-link"></span></a>入门</h2><div class="wrap-body">
</div></div><div class="h2wrap-body"><div class="wrap h3body-not-exist row-span-2"><div class="wrap-header h3wrap"><h3 id="hellojava"><a aria-hidden="true" tabindex="-1" href="#hellojava"><span class="icon icon-link"></span></a>Hello.java</h3><div class="wrap-body">
<!--rehype:wrap-class=row-span-2-->
<pre class="language-java"><code class="language-java code-highlight"><span class="code-line"><span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">Hello</span> <span class="token punctuation">{</span>
@ -296,7 +296,7 @@
</span></code></pre>
<p>一旦创建就不能修改任何修改都会创建一个新的String</p>
</div></div></div></div></div><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="java-数组"><a aria-hidden="true" tabindex="-1" href="#java-数组"><span class="icon icon-link"></span></a>Java 数组</h2><div class="wrap-body">
</div></div><div class="h2wrap-body"><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="明-declare"><a aria-hidden="true" tabindex="-1" href="#明-declare"><span class="icon icon-link"></span></a>明 Declare</h3><div class="wrap-body">
</div></div><div class="h2wrap-body"><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="明-declare"><a aria-hidden="true" tabindex="-1" href="#明-declare"><span class="icon icon-link"></span></a>明 Declare</h3><div class="wrap-body">
<pre class="language-java"><code class="language-java code-highlight"><span class="code-line"><span class="token keyword">int</span><span class="token punctuation">[</span><span class="token punctuation">]</span> a1<span class="token punctuation">;</span>
</span><span class="code-line"><span class="token keyword">int</span><span class="token punctuation">[</span><span class="token punctuation">]</span> a2 <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">}</span><span class="token punctuation">;</span>
</span><span class="code-line"><span class="token keyword">int</span><span class="token punctuation">[</span><span class="token punctuation">]</span> a3 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token keyword">int</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">{</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">}</span><span class="token punctuation">;</span>