﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-steinqiao</title><link>http://www.blogjava.net/steinqiao/</link><description /><language>zh-cn</language><lastBuildDate>Tue, 14 Apr 2026 10:35:50 GMT</lastBuildDate><pubDate>Tue, 14 Apr 2026 10:35:50 GMT</pubDate><ttl>60</ttl><item><title>java SE 接口</title><link>http://www.blogjava.net/steinqiao/archive/2011/11/24/364755.html</link><dc:creator>斯坦</dc:creator><author>斯坦</author><pubDate>Thu, 24 Nov 2011 09:42:00 GMT</pubDate><guid>http://www.blogjava.net/steinqiao/archive/2011/11/24/364755.html</guid><wfw:comment>http://www.blogjava.net/steinqiao/comments/364755.html</wfw:comment><comments>http://www.blogjava.net/steinqiao/archive/2011/11/24/364755.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/steinqiao/comments/commentRss/364755.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/steinqiao/services/trackbacks/364755.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;  &nbsp;  &nbsp;  Java SE Lesson 3  &nbsp;  1.&nbsp;&nbsp; 接口中所声明的方法都是抽象方法。接口中的方法都是 public 的。  2.&nbsp;&nbsp; 接口中也可以定义成员变量。接口中的成员变量都是 public、final、static 的。  3.&nbsp;&nbsp; 一个类不能既是 final，又是 abst...&nbsp;&nbsp;<a href='http://www.blogjava.net/steinqiao/archive/2011/11/24/364755.html'>阅读全文</a><img src ="http://www.blogjava.net/steinqiao/aggbug/364755.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/steinqiao/" target="_blank">斯坦</a> 2011-11-24 17:42 <a href="http://www.blogjava.net/steinqiao/archive/2011/11/24/364755.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>javaSE 对前面面向对象和方法参数传递的补充</title><link>http://www.blogjava.net/steinqiao/archive/2011/11/22/364594.html</link><dc:creator>斯坦</dc:creator><author>斯坦</author><pubDate>Tue, 22 Nov 2011 14:35:00 GMT</pubDate><guid>http://www.blogjava.net/steinqiao/archive/2011/11/22/364594.html</guid><wfw:comment>http://www.blogjava.net/steinqiao/comments/364594.html</wfw:comment><comments>http://www.blogjava.net/steinqiao/archive/2011/11/22/364594.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/steinqiao/comments/commentRss/364594.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/steinqiao/services/trackbacks/364594.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;  &nbsp;  &nbsp;  JAVA SE Lesson 1  &nbsp;  &nbsp;  1.&nbsp;类是一种抽象的概念，对象是类的一种具体表示形式，是具  &nbsp;  体的概念。先有类，然后由类来生成对象（Object）。对象又  &nbsp;  叫做实例（Instance）。  &nbsp;  2.&nbsp;类由两大部分构成：属性以及方法。属性一般用名词来表...&nbsp;&nbsp;<a href='http://www.blogjava.net/steinqiao/archive/2011/11/22/364594.html'>阅读全文</a><img src ="http://www.blogjava.net/steinqiao/aggbug/364594.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/steinqiao/" target="_blank">斯坦</a> 2011-11-22 22:35 <a href="http://www.blogjava.net/steinqiao/archive/2011/11/22/364594.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>java SE 面向对象之封装</title><link>http://www.blogjava.net/steinqiao/archive/2011/11/21/364476.html</link><dc:creator>斯坦</dc:creator><author>斯坦</author><pubDate>Mon, 21 Nov 2011 12:57:00 GMT</pubDate><guid>http://www.blogjava.net/steinqiao/archive/2011/11/21/364476.html</guid><wfw:comment>http://www.blogjava.net/steinqiao/comments/364476.html</wfw:comment><comments>http://www.blogjava.net/steinqiao/archive/2011/11/21/364476.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/steinqiao/comments/commentRss/364476.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/steinqiao/services/trackbacks/364476.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;  &nbsp;  &nbsp;  Java SE &nbsp;第九讲  &nbsp;  1.&nbsp;&nbsp; 面向对象程序设计的三大基本特征：继承（Inheritence）、封装（Encapsulation）、多态  （Polymorphism）  2.&nbsp;&nbsp; 封装：类包含了数据与方法，将数据与方法放在一个类中就构成了封装。  3.&nbsp;&nbsp; ...&nbsp;&nbsp;<a href='http://www.blogjava.net/steinqiao/archive/2011/11/21/364476.html'>阅读全文</a><img src ="http://www.blogjava.net/steinqiao/aggbug/364476.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/steinqiao/" target="_blank">斯坦</a> 2011-11-21 20:57 <a href="http://www.blogjava.net/steinqiao/archive/2011/11/21/364476.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>java SE 控制流程</title><link>http://www.blogjava.net/steinqiao/archive/2011/11/18/364286.html</link><dc:creator>斯坦</dc:creator><author>斯坦</author><pubDate>Fri, 18 Nov 2011 13:16:00 GMT</pubDate><guid>http://www.blogjava.net/steinqiao/archive/2011/11/18/364286.html</guid><wfw:comment>http://www.blogjava.net/steinqiao/comments/364286.html</wfw:comment><comments>http://www.blogjava.net/steinqiao/archive/2011/11/18/364286.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/steinqiao/comments/commentRss/364286.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/steinqiao/services/trackbacks/364286.html</trackback:ping><description><![CDATA[<div>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.85pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Java</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>SE </strong>&nbsp;</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">第六节</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:20.45pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">1.&nbsp;&nbsp; </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">条件运算符（三元表达式），其形式为：</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">type d = a</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>? b :</strong> <strong>c;</strong>&nbsp;</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">具体化形式为：</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">int d =</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>2</strong> <strong>&lt; 1 ? 3 : 4;</strong></span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">2.</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;&nbsp; </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">轻量级的文本编辑器：</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">UltraEdit</span></strong><span style="font-size: 11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">、</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">Editplus</span></strong><span style="font-size: 11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">、</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">vi</span></strong><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">、</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">vim</span></strong><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">、</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">gvim</span></strong></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">3.</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;&nbsp; </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">流程控制语句</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>if</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">的用法为：</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:76.5pt;text-align:left; line-height:19.8pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">第一种形式：</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:76.5pt;text-align:left; line-height:21.85pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">if(</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">布尔表达式</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">)</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">{</span></strong></p>  <p style="margin-left:101.1pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">//</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">待执行的代码</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">}</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:76.5pt;text-align:left; line-height:20.45pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">第二种形式：</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:76.5pt;text-align:left; line-height:21.85pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">if(</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">布尔表达式</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">)</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">{</span></strong></p>  <p style="margin-left:101.1pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">//</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">待执行的代码</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">}</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">else</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">{</span></strong></p>  <p style="margin-left:101.1pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">//</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">待执行的代码</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">}</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:76.5pt;text-align:left; line-height:20.45pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">第三种形式：</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:76.5pt;text-align:left; line-height:21.85pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">if(</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">布尔表达式</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">)</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">{</span></strong></p>  <p style="margin-left:101.1pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">//</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">待执行的代码</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">}</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">else</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>if(</strong></span><span style="font-size: 11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">布尔表达式</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">)</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">{</span></strong></p>  <p style="margin-left:101.1pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">//</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">待执行的代码</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">}</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">else</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>if(</strong></span><span style="font-size: 11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">布尔表达式</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">)</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">{</span></strong></p>  <p style="margin-left:101.1pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">//</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">待执行的代码</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">}</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">else</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">{</span></strong></p>  <p style="margin-left:101.1pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">//</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">待执行的代码</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">}</span></strong></p>  </div>  <span style="font-size:10.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"><br style="page-break-before:always;" clear="all" /> </span>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.85pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">4.</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;&nbsp; <strong>switch</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">语句，使用形式为：</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:76.5pt;text-align:left; line-height:20.45pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">switch(</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">变量</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">)</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>//</strong></span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">此处的变量类型就目前所学内容来看，只能为</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>4</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">种类型：</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">byte,</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>short,</strong> <strong>int, </strong></span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">char</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">。</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">{</span></strong></p>  <p style="margin-left:101.1pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">case</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">常量</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>1:</strong></span></p>  <p style="margin-left:122.95pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">//</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">待执行的代码</span></p>  <p style="margin-left:122.95pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">break;</span></strong></p>  <p style="margin-left:101.1pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">case</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">常量</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>2:</strong></span></p>  <p style="margin-left:122.95pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">//</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">待执行的代码</span></p>  <p style="margin-left:122.95pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">break;</span></strong></p>  <p style="margin-left:101.1pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">case</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">常量</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>3:</strong></span></p>  <p style="margin-left:122.95pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">//</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">待执行的代码</span></p>  <p style="margin-left:122.95pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">break;</span></strong></p>  <p style="margin-left:101.1pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">default</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">：</span></p>  <p style="margin-left:122.95pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">//</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">待执行的代码</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">}</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:76.5pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">虽然</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>case</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">语句中的</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>break</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">是可选的，但在绝大多数情况下，如果没有</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>break</strong></span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">，程序的逻</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">辑就会发生错误，因此，通常情况下都需要加上</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>break</strong></span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">。</span></p><div><p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left"><br /></p> <p style="margin-left:58.05pt;text-align:left; line-height:21.85pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">Java SE&nbsp;</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">第</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> 7 </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">讲</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:20.45pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">1.<span>&nbsp;&nbsp; </span>Java </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">中的循环控制语句一共有</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> 3 </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">种，分别是</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> while</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">，</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">do&#8230; while </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">以及</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> for </span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">循环。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">2.<span>&nbsp;&nbsp; </span>while </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">循环，形式为：</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">while(</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">布尔表达式</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">)</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">{</span></strong></p>  <p style="margin-left:101.1pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">//</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">待执行的代码</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">}</span></strong></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">3.<span>&nbsp;&nbsp; </span>do&#8230;while </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">循环，新式为：</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">do</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">{</span></strong></p>  <p style="margin-left:101.1pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">//</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">待执行的代码</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">}</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">while(</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">布尔表达式</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">);</span></strong></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">4.</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;&nbsp; <strong>while</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">与</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>do&#8230;while</strong><span> </span></span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">之间的区别：如果布尔表达式的第一次判断就为</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>false</strong></span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">，那么</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>while</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">循</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">环一次也不执行；</span><strong><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">do&#8230;while</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">循环则会执行一次。如果布尔表达式第一次判断为</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;<strong>true</strong></span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">，</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">那么</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>while</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">循环与</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>do&#8230;while</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">循环等价。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">5.</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;&nbsp; <strong>for</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">循环（使用最多的一种循环），形式为：</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">for(</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">变量初始化</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">; </span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">&nbsp;</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">条件判断</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">; </span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">&nbsp;</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">步进</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">)</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">{</span></strong></p>  <p style="margin-left:101.1pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">//</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">待执行的代码</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:10.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">}</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:76.5pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">for</span></strong> <span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">循环的执行过程：</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">1</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）</span> <span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">执行变量初始化。</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">2</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）</span> <span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">执行条件判断。如果条件判断结果为假，那么退出</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>for</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">循环，开始执行循环后面的</span></p>  <p style="margin-left:94.95pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">代码；如果条件判断为真，执行</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>for</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">循环里面的代码。</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">3</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）</span> <span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">执行步进。</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">4</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）</span> <span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">重复步骤</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>2</strong></span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">。</span></p></div><img src ="http://www.blogjava.net/steinqiao/aggbug/364286.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/steinqiao/" target="_blank">斯坦</a> 2011-11-18 21:16 <a href="http://www.blogjava.net/steinqiao/archive/2011/11/18/364286.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>java SE 运算符</title><link>http://www.blogjava.net/steinqiao/archive/2011/11/17/364133.html</link><dc:creator>斯坦</dc:creator><author>斯坦</author><pubDate>Thu, 17 Nov 2011 14:14:00 GMT</pubDate><guid>http://www.blogjava.net/steinqiao/archive/2011/11/17/364133.html</guid><wfw:comment>http://www.blogjava.net/steinqiao/comments/364133.html</wfw:comment><comments>http://www.blogjava.net/steinqiao/archive/2011/11/17/364133.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/steinqiao/comments/commentRss/364133.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/steinqiao/services/trackbacks/364133.html</trackback:ping><description><![CDATA[<p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:22.5pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Java</span></strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>SE </strong>&nbsp;</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">第四讲：</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:19.8pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">1.</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;&nbsp; </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">当有若干个变量参与运算时，结果类型取决于这些变量中表示范围最大的那个变量类型。</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">比如，参与运算的变量中，有整型</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>int</strong></span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">，有双精度浮点型</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>double</strong></span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">，有短整型</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>short</strong></span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">，那么</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">最后的结果类型就是</span><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>double</strong></span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">2.</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;&nbsp; <strong>int a</strong> <strong>= 1;</strong></span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">int b =</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>2;</strong></span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">double c</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>= (double)a / b; </strong></span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:76.5pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">上面的代码中，</span><strong><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">a</span></strong> <span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">与</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>b</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">都是整型，但是通过</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">(double)a</span></strong> <span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">这种转换将</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>a</strong> </span><span style="font-size: 11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">转换为一个匿名的变</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">量，该变量的类型是</span><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>double</strong></span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">，但是要注意：</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">a</span></strong> <span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">本身依旧是</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>int</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">类型，而不是</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>double</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">类型，</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">这样，</span><strong><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">(double)a / b</span></strong> <span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">就是</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>double</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">类型除以</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>int</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">类型，结果自然是</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>double</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">类型。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">3.&nbsp;&nbsp; </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">取模运算符：使用</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">%</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">表示。</span></p>  <p style="margin-left:101.1pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">int a = 5;</span></p>  <p style="margin-left:101.1pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">int b = 3;</span></p>  <p style="margin-left:101.1pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:101.1pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">int c = a % b; </span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">上面代码的运行结果是</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>2</strong></span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">，因为</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>5</strong> </span><span style="font-size: 11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">除以</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>3</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">结果是</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>1</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">余</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>2</strong></span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">。</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:76.5pt;text-align:left; line-height:20.45pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">取模的规律：取模的结果符号永远与被除数的符号相同</span></p>  <p style="margin-left:98.35pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:98.35pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:98.35pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">int a = 5;</span></strong></p>  <p style="margin-left:101.1pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">int b =</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>-3;</strong></span></p>  <p style="margin-left:101.1pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:101.1pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">int c = a % b;</span></strong></p>  <p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">被除数是</span><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>5</strong></span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">，那么取模的结果是</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>2</strong></span></p>  <p style="margin-left:98.35pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:98.35pt;text-align:left; line-height:20.45pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">int a = -5;</span></strong></p>  <p style="margin-left:101.1pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">int b =</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>3;</strong></span></p>  <p style="margin-left:101.1pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:101.1pt;text-align:left; line-height:20.45pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">int c = a % b;</span></strong></p>  <p style="margin-left: 76.5pt; text-align: left; line-height: 16.35pt;" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">被除数是</span><strong><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">-5</span></strong><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">，那么取模的结果是</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">-2</span></strong><span style="font-size: 11pt; font-family: 宋体; color: black;">。</span></p><p style="margin-left: 76.5pt; text-align: left; line-height: 16.35pt;" align="left">  </p><p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:22.5pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Java</span></strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>SE </strong>&nbsp;</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">第五讲：</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:19.8pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">1.&nbsp;&nbsp; </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">关系运算符：大于（</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&gt;</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）、小于（</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&lt;</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）、等于（</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">==</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）、不等于（</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">!=</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）、大于等于（</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&gt;=</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）、小于等</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">于（</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">&lt;=</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">），关系运算的结果是个</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> boolean </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">值。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">2.&nbsp;&nbsp; </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">逻辑运算符：重点讲解两个，逻辑运算符本身也返回一个</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> boolean </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">值。</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">1</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）</span> <span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">逻辑与：使用</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">&amp;&amp;</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">表示，逻辑与是个双目运算符（即有两个操作数的运算符），只有</span></p>  <p style="margin-left:94.95pt;text-align:left; line-height:14.3pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">当两个操作数都为真的时候，结果才为真；其余情况结果均为假。逻辑与表示的并</span></p>  <p style="margin-left:94.95pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">且的意思。</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:17.05pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">2</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）</span> <span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">逻辑或：使用</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">||</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">表示，逻辑或也是个双目运算符，只有当两个操作数都为假的时候，</span></p>  <p style="margin-left:94.95pt;text-align:left; line-height:14.3pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">结果才为假；其余情况结果均为真。逻辑或表示或者的意思。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:17.75pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">3.&nbsp;&nbsp; </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">关于逻辑运算符的短路特性。</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">1</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）</span> <span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">逻辑与：如果第一个操作数为</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> false</span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">，那么结果肯定就是</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> false</span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">，所以在这种情况下，</span></p>  <p style="margin-left:94.95pt;text-align:left; line-height:15.0pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">将不会执行逻辑与后面的运算了，即发生了短路。</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:17.05pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">2</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）</span> <span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">逻辑或：如果第一个操作数为</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> true</span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">，那么结果肯定就是</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> true</span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">，所在在这种情况下，</span></p>  <p style="margin-left:94.95pt;text-align:left; line-height:15.0pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">将不会执行逻辑或后面的运算了，即发生了短路。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:17.05pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">4.&nbsp;&nbsp; </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">关于变量的自增与自减运算。</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">1</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）</span> <span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">关于</span><span style="font-size: 11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> int b = a++</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">，作用是将</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> a </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">的值先赋给</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> b</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">，然后再让</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> a </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">自增</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> 1.</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">2</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）</span> <span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">关于</span><span style="font-size: 11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> int b = ++a</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">，作用是将</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> a </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">的值先自增</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> 1</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">，然后将自增后的结果赋给</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> b</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">。</span></p><img src ="http://www.blogjava.net/steinqiao/aggbug/364133.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/steinqiao/" target="_blank">斯坦</a> 2011-11-17 22:14 <a href="http://www.blogjava.net/steinqiao/archive/2011/11/17/364133.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>java SE 原生数据类型</title><link>http://www.blogjava.net/steinqiao/archive/2011/11/16/363988.html</link><dc:creator>斯坦</dc:creator><author>斯坦</author><pubDate>Wed, 16 Nov 2011 11:36:00 GMT</pubDate><guid>http://www.blogjava.net/steinqiao/archive/2011/11/16/363988.html</guid><wfw:comment>http://www.blogjava.net/steinqiao/comments/363988.html</wfw:comment><comments>http://www.blogjava.net/steinqiao/archive/2011/11/16/363988.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/steinqiao/comments/commentRss/363988.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/steinqiao/services/trackbacks/363988.html</trackback:ping><description><![CDATA[<div><p style="margin-left:58.05pt;text-align:left; line-height:22.5pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Java</span></strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>SE </strong>&nbsp;</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">第二讲：</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:20.45pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">1.&nbsp;Windows: notepad, editplus, ultraedit, gvim </span></p>  <p style="margin-left: 76.5pt; text-align: left; line-height: 16.35pt;" align="left"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; color: black;">Linux: vi, vim, gedit</span></p><p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">（这个是编写java的编辑器）</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">2.</span></strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;<strong>Java</strong> </span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">中的数据类型分为两大类：</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">1</span></strong><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）原生数据类型</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">（</span><strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">Primitive</span></strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>Data</strong> <strong>Type</strong></span><span style="font-size: 12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">2</span></strong><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）引用类型（对象类型）</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">（</span><strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">Reference Type</span></strong><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">3.</span></strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">变量与常量：所谓常量，就是值不会变化的量；所谓变量，就是值可以变化</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.0pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">的量。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.85pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">4.</span></strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">如何定义变量？</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">变量类型</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">&nbsp;</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">变量名</span><strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">;</span></strong></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">int a;</span></strong></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">5.</span></strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">如何为变量赋值？</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">变量名</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">&nbsp;<strong>= </strong>&nbsp;</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">变量值</span><strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">;</span></strong></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">a</span></strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>= 2;</strong></span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">= </span></strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">表示赋值，将等号右边的值赋给了左边的变量。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Java</span></strong> <span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">中使用</span><strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">==</span></strong><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">表示相等，等价于数学中的</span><strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">=</span></strong><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">6</span></strong><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">．综合变量定义与赋值。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:20.45pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">变量类型</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">&nbsp;</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">变量名</span><strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">;</span></strong></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">变量名</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">&nbsp;<strong>= </strong>&nbsp;</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">变量值</span><strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">;</span></strong></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:20.45pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">int a;</span></strong></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">a</span></strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>= 1;</strong></span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:19.8pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">可以将上面两个步骤合二为一：</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:22.5pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">变量类型</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">&nbsp;</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">变量名</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">&nbsp;<strong>= </strong>&nbsp;</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">变量值</span><strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">;</span></strong></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">int a</span></strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>= 1;</strong></span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">7.</span></strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">变量名：在</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>Java</strong> </span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">中，变量名以下划线、字母、</span><strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">$</span></strong><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">符号开头，并且后跟下划线、</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">字母、</span><strong><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">$</span></strong><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">符号以及数字。总之，</span><strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">Java</span></strong> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">中的变量名不能以数字开头。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:20.45pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Java</span></strong> <span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">中的原生数据类型共有</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>8</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">种：</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">1</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）</span> <span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">整型：使用</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> int </span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">表示。（</span><span style="font-size: 11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">32 </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">位）</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">2</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）</span> <span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">字节型：使用</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> byte </span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">表示。（表示</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">-128</span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">～</span><span style="font-size: 11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">127 </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">之间的</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> 256 </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">个整数）。</span></p>  </div>  <span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"><br style="page-break-before:always;" clear="all" /> </span>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.85pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">3</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）短整型：使用</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> short </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">表示。（</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">16 </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">位）</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">4</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）长整型：使用</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> long </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">表示。（</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">64 </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">位）</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">8.&nbsp;</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">关于计算机系统中的数据表示</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">位：</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">bit</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">（只有</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> 0</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">，</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">1 </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">两种状态），是计算机系统中的最小数据表示单位。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">字节：</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">byte</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">，</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;<strong>1</strong> <strong>byte = 8 bit</strong></span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">1 </span></strong><strong><span style="font-size:10.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">KB</span></strong> <strong><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">= 1024 Byte</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">（</span><strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">1Kg =</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>1000g</strong></span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">，与计算机系统不同）</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">1 MB = 1024</span></strong><strong><span style="font-size:10.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> KB</span></strong></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">1 GB</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>= 1024</strong> <strong>MB</strong></span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.85pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">9</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">．注释。注释是给人看的，不是给计算机看的。</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">Java </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">中共有</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> 3 </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">种类型的注释：</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">1</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）单行注释：以</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">//</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">开头，</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">//</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">后面的所有内容均被当作注释处理。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">2</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）多行注释：以</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">/*</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">开头，以</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">*/</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">结束，中间的所有内容均被当作注释处理。多行注释来源于</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">C/C++</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">。关于多行注释，需要注意的是，多行注释不能嵌套。</span></p>  <p style="margin-left: 58.05pt; text-align: left; line-height: 15.7pt;" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">3</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）另一种多行注释。用于产生</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> Java Doc </span><span style="font-size: 11pt; font-family: 宋体; color: black;">帮助文档。暂且不介绍。</span></p><p style="margin-left: 58.05pt; text-align: left; line-height: 15.7pt;" align="left">  </p><p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:22.5pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Java</span></strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>SE </strong>&nbsp;</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">第三讲：</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:19.8pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">1.</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;&nbsp; <strong>Java</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">中的原生数据类型共有</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>8</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">种：</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">1</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）</span> <span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">整型：使用</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> int </span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">表示。（</span><span style="font-size: 11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">32 </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">位）</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">2</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）</span> <span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">字节型：使用</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> byte </span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">表示。（表示</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">-128</span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">～</span><span style="font-size: 11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">127 </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">之间的</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> 256 </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">个整数，</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;8 </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">位）。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">3</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）短整型：使用</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> short </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">表示。（</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">16 </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">位）</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">4</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）长整型：使用</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> long </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">表示。（</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">64 </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">位）</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">5</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）单精度浮点型：使用</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> float </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">表示。所谓浮点型，指的就是小数，也叫做实数，比如</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>1.2</strong></span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">6</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）双精度浮点型：使用</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> double </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">表示。双精度浮点型表示的数据范围要比单精度浮点型大。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">7</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）字符型：使用</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> char </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">表示（</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">char </span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">是</span><span style="font-size: 11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> character </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">的缩写）。所谓字符，就是单个的字符表示，</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">比如字母</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> a</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">，或者中文张，外面用单引号包围上。比如</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> char a = &#8216;B&#8217;; char b = &#8216;</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">张</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&#8217;;</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">8</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）布尔类型，使用</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> boolean </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">表示。布尔类型只有两种可能值，分别是</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> true </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">与</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> false</span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">2.</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;&nbsp; <strong>Java</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">中的所有浮点类型默认情况下都是</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>double</strong></span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">。不能将</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>double</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">类型的值赋给</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>float</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">类型</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">的变量，即便该</span><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>double</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">类型的值处于</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>float</strong> </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">类型的范围内也是不可以的。总之，能否成</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.0pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">功赋值取决于等号右边的值类型与等号左边的变量类型是否一致。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:17.05pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">3.&nbsp;&nbsp; </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">如何将</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> double </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">类型的值赋给</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> float </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">类型的变量？答案就是</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">(1)</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">强制类型转换，将</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> double </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">类</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">型的值强制转换为</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> float </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">类型。</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">(2)</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">使用</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> java </span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">预言的支持。</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">强制转换的语法：</span><span style="font-size:11.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">&nbsp;</span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">类型</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">&nbsp;</span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">变量名</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;=&nbsp;</span><span style="font-size: 11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">（类型）变量值</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">;</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">4.&nbsp;&nbsp; </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">变量在使用前必须要赋值；变量必须要声明其类型方可使用；变量在使用前必须要定义，</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.0pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">并且只能定义一次。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:17.05pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">5.&nbsp;&nbsp; </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">如下代码无法通过编译：</span></p>  <p style="margin-left:103.15pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">int a = 1; </span></p>  <p style="margin-left:101.1pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">short b = a;</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:76.5pt;text-align:left; line-height:21.85pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">a </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">是</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> int </span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">类型，</span><span style="font-size: 11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">b </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">是</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> short </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">类型，</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">int </span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">类型表示的数据范围要比</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> short </span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">类型大，不能将表示</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:14.3pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">范围大的值赋给表示范围小的变量。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:17.05pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">6.&nbsp;&nbsp; </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">如下代码可以通过编译：</span></p>  <p style="margin-left:98.35pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">short a = 1;</span></p>  <p style="margin-left:101.1pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">int b = a;</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">a </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">是</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> short </span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">类型，</span><span style="font-size: 11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">b </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">是</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> int </span><span style="font-size:11.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">类型，</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">int </span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">类型表示的数据范围要比</span><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> short </span><span style="font-size:11.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">类型大，可以将表示</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:14.3pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">范围小的值赋给表示范围大的变量。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:17.05pt; text-autospace:none" align="left"><strong><span style="font-size:11.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">7.</span></strong><span style="font-size:11.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;&nbsp; </span><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">总结：可以将表示范围小的值赋给表示范围大的变量；但不能直接将表示范围大的值赋</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:15.0pt; text-autospace:none" align="left"><span style="font-size:11.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">给表示范围小的变量，只能通过强制类型转换实现。</span></p><img src ="http://www.blogjava.net/steinqiao/aggbug/363988.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/steinqiao/" target="_blank">斯坦</a> 2011-11-16 19:36 <a href="http://www.blogjava.net/steinqiao/archive/2011/11/16/363988.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>java SE 第一讲</title><link>http://www.blogjava.net/steinqiao/archive/2011/11/15/363881.html</link><dc:creator>斯坦</dc:creator><author>斯坦</author><pubDate>Tue, 15 Nov 2011 14:10:00 GMT</pubDate><guid>http://www.blogjava.net/steinqiao/archive/2011/11/15/363881.html</guid><wfw:comment>http://www.blogjava.net/steinqiao/comments/363881.html</wfw:comment><comments>http://www.blogjava.net/steinqiao/archive/2011/11/15/363881.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/steinqiao/comments/commentRss/363881.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/steinqiao/services/trackbacks/363881.html</trackback:ping><description><![CDATA[<div>  <p style="margin-left:58.05pt;text-align:left; line-height:22.5pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Java</span></strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>SE </strong>&nbsp;</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">第一讲：</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:20.45pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">Java SE</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">：</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Java Standard Edition</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">Java ME: Java Micro Edition</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">Java EE</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">：</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Java Enterprise Edition</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">Java </span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">是由</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> Sun </span><span style="font-size:12.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">公司推出的（今年初被</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> Oracle </span><span style="font-size:12.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">公司收购）。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">收购价格：</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">74 </span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">亿美金</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">J2SE</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">、</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">J2ME</span><span style="font-size:12.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">、</span><span style="font-size: 12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">J2EE</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:20.45pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">JDK</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">：</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Java Development Kit&nbsp;</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">（</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Java </span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">开发必备）</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">JRE</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">：</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Java Runtime Environment&nbsp;</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">（</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Java </span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">执行环境）</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">JDK </span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">包含了</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> JRE</span><span style="font-size:12.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:20.45pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">Jdk 1.4, jdk 1.5(5.0), jdk 1.6(6.0)</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">jdk 1.5(5.0)</span><span style="font-size: 12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">：</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Tiger</span><span style="font-size:12.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">，老虎</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">jdk 1.6(6.0)</span><span style="font-size: 12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">：</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Mustang</span><span style="font-size:12.0pt;font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">，野马</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:20.45pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">1.&nbsp;</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">下载</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> JDK </span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">2.&nbsp;</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">安装</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> JDK </span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">3.&nbsp;</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">设定环境变量（可以是用户变量，也可以是系统变量），指向</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> JDK </span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">安装目录中</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">的</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> bin </span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">目录</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">4.&nbsp;</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">通过运行，输入</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> cmd </span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">打开命令行窗口，输入</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> java&nbsp;&#8211;version</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">，显示出</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> Java </span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">版本</span></p>  <p style="margin-left:76.5pt;text-align:left; line-height:14.3pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">信息</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:22.5pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">接下来就可以编写</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> Java </span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">程序了。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">可以直接使用</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> windows </span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">记事本来编写</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> Java </span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">程序，也可以使用</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> Editplus</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">，</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">UltraEdit</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">等</span> <span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">高</span> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">级</span> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">文</span> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">本</span> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">编</span> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">辑</span> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">工</span> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">具</span> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">编</span> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">写</span><span style="font-size: 12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">&nbsp;Java&nbsp;</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">程</span> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">序</span> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">，</span> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">还</span> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">可</span> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">以使</span> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">用</span> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">专</span> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">业</span> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">的</span><span style="font-size: 12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">&nbsp;IDE </span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">（</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> Integrated Development Environment</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）编写。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">第一节课，我们使用记事本实现一个</span><span style="font-size: 12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> Hello World </span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">的</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> Java </span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">程序。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:20.45pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">所有的</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;"> <strong>Java</strong> </span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">代码，其后缀都是以</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>java</strong> </span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">结尾。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Java</span></strong> <span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">程序的执行过程分为两步：</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:16.35pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">1.</span></strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">编译</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">2.</span></strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">&nbsp;</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">执行</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">Class </span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">文件是字节码文件，程序最终执行的就是这个字节码（</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">bytecode</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）文件。</span></p>  </div>  <span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"><br style="page-break-before:always;" clear="all" /> </span>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:22.5pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">编译命令：</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">javac Test.java</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:15.7pt; text-autospace:none" align="left"><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">执行命令：</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">java Test</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">（注意，</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Test </span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">后面没有</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">.class</span><span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">）</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Java</span></strong> <span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">是跨平台的语言，真正执行的不是二进制代码，而是字节码。</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">JVM</span></strong><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">（</span><strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">Java</span></strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>Virtual Machine</strong></span><span style="font-size: 12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">，</span><strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">Java</span></strong> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">虚拟机）</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:20.45pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Java</span></strong> <span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">是跨平台的，而</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>JVM</strong> </span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">不是跨平台的（</span><strong><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;; color:black;">JVM</span></strong> <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;; color:black;">是由</span><span style="font-size:12.0pt; font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>C</strong> </span><span style="font-size: 12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">语言编写的）</span></p>  <p style="margin-left:58.05pt;text-align:left; line-height:10.9pt; text-autospace:none" align="left">&nbsp;</p>  <p style="margin-left:58.05pt;text-align:left; line-height:21.15pt; text-autospace:none" align="left"><strong><span style="font-size:12.0pt;font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;color:black;">Java</span></strong> <span style="font-size:12.0pt; font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">之所以能够做到跨平台，本质原因在于</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:black;"> <strong>JVM</strong> </span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;Times New Roman&quot;;color:black;">不是跨平台的。</span></p><img src ="http://www.blogjava.net/steinqiao/aggbug/363881.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/steinqiao/" target="_blank">斯坦</a> 2011-11-15 22:10 <a href="http://www.blogjava.net/steinqiao/archive/2011/11/15/363881.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>写在开始的前面</title><link>http://www.blogjava.net/steinqiao/archive/2011/11/15/363877.html</link><dc:creator>斯坦</dc:creator><author>斯坦</author><pubDate>Tue, 15 Nov 2011 13:33:00 GMT</pubDate><guid>http://www.blogjava.net/steinqiao/archive/2011/11/15/363877.html</guid><wfw:comment>http://www.blogjava.net/steinqiao/comments/363877.html</wfw:comment><comments>http://www.blogjava.net/steinqiao/archive/2011/11/15/363877.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/steinqiao/comments/commentRss/363877.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/steinqiao/services/trackbacks/363877.html</trackback:ping><description><![CDATA[&nbsp;&nbsp; 现在发现以前学习的java知识很多都忘记了，现在重新看看，我注册了这个博客把笔记写在这里，有开始学java的可以看看，这个是圣思园张龙老师的笔记，有不懂的我可以详细说说，在电驴也可以找到相关的视频，祝大家可以学业有成！谢谢了。<br />&nbsp; 注：我一般一天看一个发表一个<img src ="http://www.blogjava.net/steinqiao/aggbug/363877.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/steinqiao/" target="_blank">斯坦</a> 2011-11-15 21:33 <a href="http://www.blogjava.net/steinqiao/archive/2011/11/15/363877.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>