{"id":64778,"date":"2026-01-24T03:48:18","date_gmt":"2026-01-23T19:48:18","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/64778.html"},"modified":"2026-01-24T03:48:18","modified_gmt":"2026-01-23T19:48:18","slug":"java%e8%af%ad%e8%a8%80%e6%8f%90%e4%be%9b%e4%ba%86%e5%85%ab%e7%a7%8d%e5%9f%ba%e6%9c%ac%e7%b1%bb%e5%9e%8b%e3%80%90%e5%87%bd%e6%95%b0%e5%92%8c%e5%9f%ba%e6%95%b0%e6%80%8e%e4%b9%88%e5%88%86%e5%88%ab","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/64778.html","title":{"rendered":"Java\u8bed\u8a00\u63d0\u4f9b\u4e86\u516b\u79cd\u57fa\u672c\u7c7b\u578b\u3010\u51fd\u6570\u548c\u57fa\u6570\u600e\u4e48\u5206\u522b\u3011"},"content":{"rendered":"<p>\u53d8\u91cf\u5c31\u662f\u7533\u8bf7\u5185\u5b58\u6765\u5b58\u50a8\u503c\u3002\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u5f53\u521b\u5efa\u53d8\u91cf\u7684\u65f6\u5019&#xff0c;\u9700\u8981\u5728\u5185\u5b58\u4e2d\u7533\u8bf7\u7a7a\u95f4\u3002<\/p>\n<p>\u5185\u5b58\u7ba1\u7406\u7cfb\u7edf\u6839\u636e\u53d8\u91cf\u7684\u7c7b\u578b\u4e3a\u53d8\u91cf\u5206\u914d\u5b58\u50a8\u7a7a\u95f4&#xff0c;\u5206\u914d\u7684\u7a7a\u95f4\u53ea\u80fd\u7528\u6765\u50a8\u5b58\u8be5\u7c7b\u578b\u6570\u636e\u3002<\/p>\n<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"115\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260123194817-6973d0813b53f.png\" width=\"321\" \/><\/p>\n<p>\u56e0\u6b64&#xff0c;\u901a\u8fc7\u5b9a\u4e49\u4e0d\u540c\u7c7b\u578b\u7684\u53d8\u91cf&#xff0c;\u53ef\u4ee5\u5728\u5185\u5b58\u4e2d\u50a8\u5b58\u6574\u6570\u3001\u5c0f\u6570\u6216\u8005\u5b57\u7b26\u3002<\/p>\n<p>Java \u7684\u4e24\u5927\u6570\u636e\u7c7b\u578b:<\/p>\n<ul>\n<li>\u5185\u7f6e\u6570\u636e\u7c7b\u578b<\/li>\n<li>\u5f15\u7528\u6570\u636e\u7c7b\u578b<\/li>\n<\/ul>\n<hr \/>\n<h3>\u5185\u7f6e\u6570\u636e\u7c7b\u578b<\/h3>\n<p>Java\u8bed\u8a00\u63d0\u4f9b\u4e86\u516b\u79cd\u57fa\u672c\u7c7b\u578b\u3002\u516d\u79cd\u6570\u5b57\u7c7b\u578b&#xff08;\u56db\u4e2a\u6574\u6570\u578b&#xff0c;\u4e24\u4e2a\u6d6e\u70b9\u578b&#xff09;&#xff0c;\u4e00\u79cd\u5b57\u7b26\u7c7b\u578b&#xff0c;\u8fd8\u6709\u4e00\u79cd\u5e03\u5c14\u578b\u3002<\/p>\n<p>byte&#xff1a;<\/p>\n<ul>\n<li>byte \u6570\u636e\u7c7b\u578b\u662f8\u4f4d\u3001\u6709\u7b26\u53f7\u7684&#xff0c;\u4ee5\u4e8c\u8fdb\u5236\u8865\u7801\u8868\u793a\u7684\u6574\u6570&#xff1b;<\/li>\n<li>\u6700\u5c0f\u503c\u662f\u00a0-128&#xff08;-2^7&#xff09;&#xff1b;<\/li>\n<li>\u6700\u5927\u503c\u662f\u00a0127&#xff08;2^7-1&#xff09;&#xff1b;<\/li>\n<li>\u9ed8\u8ba4\u503c\u662f\u00a00&#xff1b;<\/li>\n<li>byte \u7c7b\u578b\u7528\u5728\u5927\u578b\u6570\u7ec4\u4e2d\u8282\u7ea6\u7a7a\u95f4&#xff0c;\u4e3b\u8981\u4ee3\u66ff\u6574\u6570&#xff0c;\u56e0\u4e3a byte \u53d8\u91cf\u5360\u7528\u7684\u7a7a\u95f4\u53ea\u6709 int \u7c7b\u578b\u7684\u56db\u5206\u4e4b\u4e00&#xff1b;<\/li>\n<li>\u4f8b\u5b50&#xff1a;byte a &#061; 100&#xff0c;byte b &#061; -50\u3002<\/li>\n<\/ul>\n<p>short&#xff1a;<\/p>\n<ul>\n<li>short \u6570\u636e\u7c7b\u578b\u662f 16 \u4f4d\u3001\u6709\u7b26\u53f7\u7684\u4ee5\u4e8c\u8fdb\u5236\u8865\u7801\u8868\u793a\u7684\u6574\u6570<\/li>\n<li>\u6700\u5c0f\u503c\u662f\u00a0-32768&#xff08;-2^15&#xff09;&#xff1b;<\/li>\n<li>\u6700\u5927\u503c\u662f\u00a032767&#xff08;2^15 &#8211; 1&#xff09;&#xff1b;<\/li>\n<li>Short \u6570\u636e\u7c7b\u578b\u4e5f\u53ef\u4ee5\u50cf byte \u90a3\u6837\u8282\u7701\u7a7a\u95f4\u3002\u4e00\u4e2ashort\u53d8\u91cf\u662fint\u578b\u53d8\u91cf\u6240\u5360\u7a7a\u95f4\u7684\u4e8c\u5206\u4e4b\u4e00&#xff1b;<\/li>\n<li>\u9ed8\u8ba4\u503c\u662f\u00a00&#xff1b;<\/li>\n<li>\u4f8b\u5b50&#xff1a;short s &#061; 1000&#xff0c;short r &#061; -20000\u3002<\/li>\n<\/ul>\n<p>int&#xff1a;<\/p>\n<ul>\n<li>int \u6570\u636e\u7c7b\u578b\u662f32\u4f4d\u3001\u6709\u7b26\u53f7\u7684\u4ee5\u4e8c\u8fdb\u5236\u8865\u7801\u8868\u793a\u7684\u6574\u6570&#xff1b;<\/li>\n<li>\u6700\u5c0f\u503c\u662f\u00a0-2,147,483,648&#xff08;-2^31&#xff09;&#xff1b;<\/li>\n<li>\u6700\u5927\u503c\u662f\u00a02,147,483,647&#xff08;2^31 &#8211; 1&#xff09;&#xff1b;<\/li>\n<li>\u4e00\u822c\u5730\u6574\u578b\u53d8\u91cf\u9ed8\u8ba4\u4e3a int \u7c7b\u578b&#xff1b;<\/li>\n<li>\u9ed8\u8ba4\u503c\u662f\u00a00\u00a0&#xff1b;<\/li>\n<li>\u4f8b\u5b50&#xff1a;int a &#061; 100000, int b &#061; -200000\u3002<\/li>\n<\/ul>\n<p>long&#xff1a;<\/p>\n<ul>\n<li>long \u6570\u636e\u7c7b\u578b\u662f 64 \u4f4d\u3001\u6709\u7b26\u53f7\u7684\u4ee5\u4e8c\u8fdb\u5236\u8865\u7801\u8868\u793a\u7684\u6574\u6570&#xff1b;<\/li>\n<li>\u6700\u5c0f\u503c\u662f\u00a0-9,223,372,036,854,775,808&#xff08;-2^63&#xff09;&#xff1b;<\/li>\n<li>\u6700\u5927\u503c\u662f\u00a09,223,372,036,854,775,807&#xff08;2^63 -1&#xff09;&#xff1b;<\/li>\n<li>\u8fd9\u79cd\u7c7b\u578b\u4e3b\u8981\u4f7f\u7528\u5728\u9700\u8981\u6bd4\u8f83\u5927\u6574\u6570\u7684\u7cfb\u7edf\u4e0a&#xff1b;<\/li>\n<li>\u9ed8\u8ba4\u503c\u662f\u00a00L&#xff1b;<\/li>\n<li>\u4f8b\u5b50&#xff1a;\u00a0long a &#061; 100000L&#xff0c;long b &#061; -200000L\u3002 &#034;L&#034;\u7406\u8bba\u4e0a\u4e0d\u5206\u5927\u5c0f\u5199&#xff0c;\u4f46\u662f\u82e5\u5199\u6210&#034;l&#034;\u5bb9\u6613\u4e0e\u6570\u5b57&#034;1&#034;\u6df7\u6dc6&#xff0c;\u4e0d\u5bb9\u6613\u5206\u8fa9\u3002\u6240\u4ee5\u6700\u597d\u5927\u5199\u3002<\/li>\n<\/ul>\n<p>float&#xff1a;<\/p>\n<ul>\n<li>float \u6570\u636e\u7c7b\u578b\u662f\u5355\u7cbe\u5ea6\u300132\u4f4d\u3001\u7b26\u5408IEEE 754\u6807\u51c6\u7684\u6d6e\u70b9\u6570&#xff1b;<\/li>\n<li>float \u5728\u50a8\u5b58\u5927\u578b\u6d6e\u70b9\u6570\u7ec4\u7684\u65f6\u5019\u53ef\u8282\u7701\u5185\u5b58\u7a7a\u95f4&#xff1b;<\/li>\n<li>\u9ed8\u8ba4\u503c\u662f\u00a00.0f&#xff1b;<\/li>\n<li>\u6d6e\u70b9\u6570\u4e0d\u80fd\u7528\u6765\u8868\u793a\u7cbe\u786e\u7684\u503c&#xff0c;\u5982\u8d27\u5e01&#xff1b;<\/li>\n<li>\u4f8b\u5b50&#xff1a;float f1 &#061; 234.5f\u3002<\/li>\n<\/ul>\n<p>double&#xff1a;<\/p>\n<ul>\n<li>double \u6570\u636e\u7c7b\u578b\u662f\u53cc\u7cbe\u5ea6\u300164 \u4f4d\u3001\u7b26\u5408 IEEE 754 \u6807\u51c6\u7684\u6d6e\u70b9\u6570&#xff1b;<\/li>\n<li>\u6d6e\u70b9\u6570\u7684\u9ed8\u8ba4\u7c7b\u578b\u4e3a double \u7c7b\u578b&#xff1b;<\/li>\n<li>double\u7c7b\u578b\u540c\u6837\u4e0d\u80fd\u8868\u793a\u7cbe\u786e\u7684\u503c&#xff0c;\u5982\u8d27\u5e01&#xff1b;<\/li>\n<li>\u9ed8\u8ba4\u503c\u662f\u00a00.0d&#xff1b;<\/li>\n<li>\n<p>\u4f8b\u5b50&#xff1a;<\/p>\n<p> double   d1  &#061; 7D ;<br \/>\ndouble   d2  &#061; 7.;<br \/>\ndouble   d3  &#061;  8.0;<br \/>\ndouble   d4  &#061;  8.D;<br \/>\ndouble   d5  &#061;  12.9867;  <\/p>\n<p>7 \u662f\u4e00\u4e2a int \u5b57\u9762\u91cf&#xff0c;\u800c 7D&#xff0c;7. \u548c 8.0 \u662f double \u5b57\u9762\u91cf\u3002<\/p>\n<\/li>\n<\/ul>\n<p>boolean&#xff1a;<\/p>\n<ul>\n<li>boolean\u6570\u636e\u7c7b\u578b\u8868\u793a\u4e00\u4f4d\u7684\u4fe1\u606f&#xff1b;<\/li>\n<li>\u53ea\u6709\u4e24\u4e2a\u53d6\u503c&#xff1a;true \u548c false&#xff1b;<\/li>\n<li>\u8fd9\u79cd\u7c7b\u578b\u53ea\u4f5c\u4e3a\u4e00\u79cd\u6807\u5fd7\u6765\u8bb0\u5f55 true\/false \u60c5\u51b5&#xff1b;<\/li>\n<li>\u9ed8\u8ba4\u503c\u662f\u00a0false&#xff1b;<\/li>\n<li>\u4f8b\u5b50&#xff1a;boolean one &#061; true\u3002<\/li>\n<\/ul>\n<p>char&#xff1a;<\/p>\n<ul>\n<li>char \u7c7b\u578b\u662f\u4e00\u4e2a\u5355\u4e00\u7684 16 \u4f4d Unicode \u5b57\u7b26&#xff1b;<\/li>\n<li>\u6700\u5c0f\u503c\u662f\u00a0\\\\u0000&#xff08;\u5341\u8fdb\u5236\u7b49\u6548\u503c\u4e3a 0&#xff09;&#xff1b;<\/li>\n<li>\u6700\u5927\u503c\u662f\u00a0\\\\uffff&#xff08;\u5373\u4e3a 65535&#xff09;&#xff1b;<\/li>\n<li>char \u6570\u636e\u7c7b\u578b\u53ef\u4ee5\u50a8\u5b58\u4efb\u4f55\u5b57\u7b26&#xff1b;<\/li>\n<li>\u4f8b\u5b50&#xff1a;char letter &#061; &#039;A&#039;;\u3002<\/li>\n<\/ul>\n<h4>\u5b9e\u4f8b<\/h4>\n<p>\u5bf9\u4e8e\u6570\u503c\u7c7b\u578b\u7684\u57fa\u672c\u7c7b\u578b\u7684\u53d6\u503c\u8303\u56f4&#xff0c;\u6211\u4eec\u65e0\u9700\u5f3a\u5236\u53bb\u8bb0\u5fc6&#xff0c;\u56e0\u4e3a\u5b83\u4eec\u7684\u503c\u90fd\u5df2\u7ecf\u4ee5\u5e38\u91cf\u7684\u5f62\u5f0f\u5b9a\u4e49\u5728\u5bf9\u5e94\u7684\u5305\u88c5\u7c7b\u4e2d\u4e86\u3002\u8bf7\u770b\u4e0b\u9762\u7684\u4f8b\u5b50&#xff1a;<\/p>\n<h3>\u5b9e\u4f8b<\/h3>\n<p>public class PrimitiveTypeTest { public static void main(String[] args) { \/\/ byte System.out.println(&#034;\u57fa\u672c\u7c7b\u578b&#xff1a;byte \u4e8c\u8fdb\u5236\u4f4d\u6570&#xff1a;&#034; &#043; Byte.SIZE); System.out.println(&#034;\u5305\u88c5\u7c7b&#xff1a;java.lang.Byte&#034;); System.out.println(&#034;\u6700\u5c0f\u503c&#xff1a;Byte.MIN_VALUE&#061;&#034; &#043; Byte.MIN_VALUE); System.out.println(&#034;\u6700\u5927\u503c&#xff1a;Byte.MAX_VALUE&#061;&#034; &#043; Byte.MAX_VALUE); System.out.println(); \/\/ short System.out.println(&#034;\u57fa\u672c\u7c7b\u578b&#xff1a;short \u4e8c\u8fdb\u5236\u4f4d\u6570&#xff1a;&#034; &#043; Short.SIZE); System.out.println(&#034;\u5305\u88c5\u7c7b&#xff1a;java.lang.Short&#034;); System.out.println(&#034;\u6700\u5c0f\u503c&#xff1a;Short.MIN_VALUE&#061;&#034; &#043; Short.MIN_VALUE); System.out.println(&#034;\u6700\u5927\u503c&#xff1a;Short.MAX_VALUE&#061;&#034; &#043; Short.MAX_VALUE); System.out.println(); \/\/ int System.out.println(&#034;\u57fa\u672c\u7c7b\u578b&#xff1a;int \u4e8c\u8fdb\u5236\u4f4d\u6570&#xff1a;&#034; &#043; Integer.SIZE); System.out.println(&#034;\u5305\u88c5\u7c7b&#xff1a;java.lang.Integer&#034;); System.out.println(&#034;\u6700\u5c0f\u503c&#xff1a;Integer.MIN_VALUE&#061;&#034; &#043; Integer.MIN_VALUE); System.out.println(&#034;\u6700\u5927\u503c&#xff1a;Integer.MAX_VALUE&#061;&#034; &#043; Integer.MAX_VALUE); System.out.println(); \/\/ long System.out.println(&#034;\u57fa\u672c\u7c7b\u578b&#xff1a;long \u4e8c\u8fdb\u5236\u4f4d\u6570&#xff1a;&#034; &#043; Long.SIZE); System.out.println(&#034;\u5305\u88c5\u7c7b&#xff1a;java.lang.Long&#034;); System.out.println(&#034;\u6700\u5c0f\u503c&#xff1a;Long.MIN_VALUE&#061;&#034; &#043; Long.MIN_VALUE); System.out.println(&#034;\u6700\u5927\u503c&#xff1a;Long.MAX_VALUE&#061;&#034; &#043; Long.MAX_VALUE); System.out.println(); \/\/ float System.out.println(&#034;\u57fa\u672c\u7c7b\u578b&#xff1a;float \u4e8c\u8fdb\u5236\u4f4d\u6570&#xff1a;&#034; &#043; Float.SIZE); System.out.println(&#034;\u5305\u88c5\u7c7b&#xff1a;java.lang.Float&#034;); System.out.println(&#034;\u6700\u5c0f\u503c&#xff1a;Float.MIN_VALUE&#061;&#034; &#043; Float.MIN_VALUE); System.out.println(&#034;\u6700\u5927\u503c&#xff1a;Float.MAX_VALUE&#061;&#034; &#043; Float.MAX_VALUE); System.out.println(); \/\/ double System.out.println(&#034;\u57fa\u672c\u7c7b\u578b&#xff1a;double \u4e8c\u8fdb\u5236\u4f4d\u6570&#xff1a;&#034; &#043; Double.SIZE); System.out.println(&#034;\u5305\u88c5\u7c7b&#xff1a;java.lang.Double&#034;); System.out.println(&#034;\u6700\u5c0f\u503c&#xff1a;Double.MIN_VALUE&#061;&#034; &#043; Double.MIN_VALUE); System.out.println(&#034;\u6700\u5927\u503c&#xff1a;Double.MAX_VALUE&#061;&#034; &#043; Double.MAX_VALUE); System.out.println(); \/\/ char System.out.println(&#034;\u57fa\u672c\u7c7b\u578b&#xff1a;char \u4e8c\u8fdb\u5236\u4f4d\u6570&#xff1a;&#034; &#043; Character.SIZE); System.out.println(&#034;\u5305\u88c5\u7c7b&#xff1a;java.lang.Character&#034;); \/\/ \u4ee5\u6570\u503c\u5f62\u5f0f\u800c\u4e0d\u662f\u5b57\u7b26\u5f62\u5f0f\u5c06Character.MIN_VALUE\u8f93\u51fa\u5230\u63a7\u5236\u53f0 System.out.println(&#034;\u6700\u5c0f\u503c&#xff1a;Character.MIN_VALUE&#061;&#034; &#043; (int) Character.MIN_VALUE); \/\/ \u4ee5\u6570\u503c\u5f62\u5f0f\u800c\u4e0d\u662f\u5b57\u7b26\u5f62\u5f0f\u5c06Character.MAX_VALUE\u8f93\u51fa\u5230\u63a7\u5236\u53f0 System.out.println(&#034;\u6700\u5927\u503c&#xff1a;Character.MAX_VALUE&#061;&#034; &#043; (int) Character.MAX_VALUE); } }<\/p>\n<p> \u8fd0\u884c\u5b9e\u4f8b \u00bb<\/p>\n<p>\u7f16\u8bd1\u4ee5\u4e0a\u4ee3\u7801\u8f93\u51fa\u7ed3\u679c\u5982\u4e0b\u6240\u793a&#xff1a;<\/p>\n<p>\u57fa\u672c\u7c7b\u578b&#xff1a;byte \u4e8c\u8fdb\u5236\u4f4d\u6570&#xff1a;8<br \/>\n\u5305\u88c5\u7c7b&#xff1a;java.lang.Byte<br \/>\n\u6700\u5c0f\u503c&#xff1a;Byte.MIN_VALUE&#061;-128<br \/>\n\u6700\u5927\u503c&#xff1a;Byte.MAX_VALUE&#061;127<\/p>\n<p>\u57fa\u672c\u7c7b\u578b&#xff1a;short \u4e8c\u8fdb\u5236\u4f4d\u6570&#xff1a;16<br \/>\n\u5305\u88c5\u7c7b&#xff1a;java.lang.Short<br \/>\n\u6700\u5c0f\u503c&#xff1a;Short.MIN_VALUE&#061;-32768<br \/>\n\u6700\u5927\u503c&#xff1a;Short.MAX_VALUE&#061;32767<\/p>\n<p>\u57fa\u672c\u7c7b\u578b&#xff1a;int \u4e8c\u8fdb\u5236\u4f4d\u6570&#xff1a;32<br \/>\n\u5305\u88c5\u7c7b&#xff1a;java.lang.Integer<br \/>\n\u6700\u5c0f\u503c&#xff1a;Integer.MIN_VALUE&#061;-2147483648<br \/>\n\u6700\u5927\u503c&#xff1a;Integer.MAX_VALUE&#061;2147483647<\/p>\n<p>\u57fa\u672c\u7c7b\u578b&#xff1a;long \u4e8c\u8fdb\u5236\u4f4d\u6570&#xff1a;64<br \/>\n\u5305\u88c5\u7c7b&#xff1a;java.lang.Long<br \/>\n\u6700\u5c0f\u503c&#xff1a;Long.MIN_VALUE&#061;-9223372036854775808<br \/>\n\u6700\u5927\u503c&#xff1a;Long.MAX_VALUE&#061;9223372036854775807<\/p>\n<p>\u57fa\u672c\u7c7b\u578b&#xff1a;float \u4e8c\u8fdb\u5236\u4f4d\u6570&#xff1a;32<br \/>\n\u5305\u88c5\u7c7b&#xff1a;java.lang.Float<br \/>\n\u6700\u5c0f\u503c&#xff1a;Float.MIN_VALUE&#061;1.4E-45<br \/>\n\u6700\u5927\u503c&#xff1a;Float.MAX_VALUE&#061;3.4028235E38<\/p>\n<p>\u57fa\u672c\u7c7b\u578b&#xff1a;double \u4e8c\u8fdb\u5236\u4f4d\u6570&#xff1a;64<br \/>\n\u5305\u88c5\u7c7b&#xff1a;java.lang.Double<br \/>\n\u6700\u5c0f\u503c&#xff1a;Double.MIN_VALUE&#061;4.9E-324<br \/>\n\u6700\u5927\u503c&#xff1a;Double.MAX_VALUE&#061;1.7976931348623157E308<\/p>\n<p>\u57fa\u672c\u7c7b\u578b&#xff1a;char \u4e8c\u8fdb\u5236\u4f4d\u6570&#xff1a;16<br \/>\n\u5305\u88c5\u7c7b&#xff1a;java.lang.Character<br \/>\n\u6700\u5c0f\u503c&#xff1a;Character.MIN_VALUE&#061;0<br \/>\n\u6700\u5927\u503c&#xff1a;Character.MAX_VALUE&#061;65535 <\/p>\n<p>Float\u548cDouble\u7684\u6700\u5c0f\u503c\u548c\u6700\u5927\u503c\u90fd\u662f\u4ee5\u79d1\u5b66\u8bb0\u6570\u6cd5\u7684\u5f62\u5f0f\u8f93\u51fa\u7684&#xff0c;\u7ed3\u5c3e\u7684&#034;E&#043;\u6570\u5b57&#034;\u8868\u793aE\u4e4b\u524d\u7684\u6570\u5b57\u8981\u4e58\u4ee510\u7684\u591a\u5c11\u6b21\u65b9\u3002\u6bd4\u59823.14E3\u5c31\u662f3.14 \u00d7 103\u00a0&#061;3140&#xff0c;3.14E-3 \u5c31\u662f 3.14 x 10-3\u00a0&#061;0.00314\u3002<\/p>\n<p>https:\/\/avg.163.com\/topic\/detail\/9165980 https:\/\/avg.163.com\/topic\/detail\/9165979 https:\/\/avg.163.com\/topic\/detail\/9165977 https:\/\/avg.163.com\/topic\/detail\/9165956 https:\/\/avg.163.com\/topic\/detail\/9165915 https:\/\/avg.163.com\/topic\/detail\/9165786 https:\/\/avg.163.com\/topic\/detail\/9165753 https:\/\/avg.163.com\/topic\/detail\/9165742 https:\/\/avg.163.com\/topic\/detail\/9165734 https:\/\/avg.163.com\/topic\/detail\/9165710 https:\/\/avg.163.com\/topic\/detail\/9165708 https:\/\/avg.163.com\/topic\/detail\/9165706 https:\/\/avg.163.com\/topic\/detail\/9165702 https:\/\/avg.163.com\/topic\/detail\/9165701 https:\/\/avg.163.com\/topic\/detail\/9165700 https:\/\/avg.163.com\/topic\/detail\/9165698 https:\/\/avg.163.com\/topic\/detail\/9165695 https:\/\/avg.163.com\/topic\/detail\/9165694 https:\/\/avg.163.com\/topic\/detail\/9165691 https:\/\/avg.163.com\/topic\/detail\/9165690 https:\/\/avg.163.com\/topic\/detail\/9165689 https:\/\/avg.163.com\/topic\/detail\/9165687 https:\/\/avg.163.com\/topic\/detail\/9165686 https:\/\/avg.163.com\/topic\/detail\/9165682 https:\/\/avg.163.com\/topic\/detail\/9165106 https:\/\/avg.163.com\/topic\/detail\/9164711 https:\/\/avg.163.com\/topic\/detail\/9164249 https:\/\/avg.163.com\/topic\/detail\/9163805 https:\/\/avg.163.com\/topic\/detail\/9163417 https:\/\/avg.163.com\/topic\/detail\/9163318 https:\/\/avg.163.com\/topic\/detail\/9163298 https:\/\/avg.163.com\/topic\/detail\/9163216 https:\/\/avg.163.com\/topic\/detail\/9163174 https:\/\/avg.163.com\/topic\/detail\/9163123 https:\/\/avg.163.com\/topic\/detail\/9163061 https:\/\/avg.163.com\/topic\/detail\/9163000 https:\/\/avg.163.com\/topic\/detail\/9162932 https:\/\/avg.163.com\/topic\/detail\/9162860 https:\/\/avg.163.com\/topic\/detail\/9162317 https:\/\/avg.163.com\/topic\/detail\/9161852 https:\/\/avg.163.com\/topic\/detail\/9161478 https:\/\/avg.163.com\/topic\/detail\/9161046 https:\/\/avg.163.com\/topic\/detail\/9160572 https:\/\/avg.163.com\/topic\/detail\/9160073 https:\/\/avg.163.com\/topic\/detail\/9159660 https:\/\/avg.163.com\/topic\/detail\/9159380 https:\/\/avg.163.com\/topic\/detail\/9159268 https:\/\/avg.163.com\/topic\/detail\/9159165 https:\/\/avg.163.com\/topic\/detail\/9159107 https:\/\/avg.163.com\/topic\/detail\/9159033 https:\/\/avg.163.com\/topic\/detail\/9158993 https:\/\/avg.163.com\/topic\/detail\/9158960 https:\/\/avg.163.com\/topic\/detail\/9158947 https:\/\/avg.163.com\/topic\/detail\/9158934<\/p>\n<p>https:\/\/avg.163.com\/topic\/detail\/9073079 https:\/\/avg.163.com\/topic\/detail\/9072421 https:\/\/avg.163.com\/topic\/detail\/9071984 https:\/\/avg.163.com\/topic\/detail\/9071810 https:\/\/avg.163.com\/topic\/detail\/9071690 https:\/\/avg.163.com\/topic\/detail\/9071601 https:\/\/avg.163.com\/topic\/detail\/9071560 https:\/\/avg.163.com\/topic\/detail\/9071533 https:\/\/avg.163.com\/topic\/detail\/9071481 https:\/\/avg.163.com\/topic\/detail\/9071348 https:\/\/avg.163.com\/topic\/detail\/9071199 https:\/\/avg.163.com\/topic\/detail\/9070921 https:\/\/avg.163.com\/topic\/detail\/9070650 https:\/\/avg.163.com\/topic\/detail\/9070310 https:\/\/avg.163.com\/topic\/detail\/9070031 https:\/\/avg.163.com\/topic\/detail\/9069847 https:\/\/avg.163.com\/topic\/detail\/9069636 https:\/\/avg.163.com\/topic\/detail\/9069487 https:\/\/avg.163.com\/topic\/detail\/9069444 https:\/\/avg.163.com\/topic\/detail\/9069394 https:\/\/avg.163.com\/topic\/detail\/9069352 https:\/\/avg.163.com\/topic\/detail\/9069325 https:\/\/avg.163.com\/topic\/detail\/9068985 https:\/\/avg.163.com\/topic\/detail\/9068338 https:\/\/avg.163.com\/topic\/detail\/9064843 https:\/\/avg.163.com\/topic\/detail\/9064832 https:\/\/avg.163.com\/topic\/detail\/9064822 https:\/\/avg.163.com\/topic\/detail\/9064811 https:\/\/avg.163.com\/topic\/detail\/9064523 \u00a0<\/p>\n<p>\u5b9e\u9645\u4e0a&#xff0c;JAVA\u4e2d\u8fd8\u5b58\u5728\u53e6\u5916\u4e00\u79cd\u57fa\u672c\u7c7b\u578b void&#xff0c;\u5b83\u4e5f\u6709\u5bf9\u5e94\u7684\u5305\u88c5\u7c7b java.lang.Void&#xff0c;\u4e0d\u8fc7\u6211\u4eec\u65e0\u6cd5\u76f4\u63a5\u5bf9\u5b83\u4eec\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n<h4>\u7c7b\u578b\u9ed8\u8ba4\u503c<\/h4>\n<p>\u4e0b\u8868\u5217\u51fa\u4e86 Java \u5404\u4e2a\u7c7b\u578b\u7684\u9ed8\u8ba4\u503c&#xff1a;<\/p>\n<table>\n<tr>\u6570\u636e\u7c7b\u578b\u9ed8\u8ba4\u503c<\/tr>\n<tbody>\n<tr>\n<td>int<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>long<\/td>\n<td>0L<\/td>\n<\/tr>\n<tr>\n<td>short<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>char<\/td>\n<td>&#039;\\\\u0000&#039;<\/td>\n<\/tr>\n<tr>\n<td>byte<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>float<\/td>\n<td>0.0f<\/td>\n<\/tr>\n<tr>\n<td>double<\/td>\n<td>0.0d<\/td>\n<\/tr>\n<tr>\n<td>boolean<\/td>\n<td>false<\/td>\n<\/tr>\n<tr>\n<td>\u5f15\u7528\u7c7b\u578b&#xff08;\u7c7b\u3001\u63a5\u53e3\u3001\u6570\u7ec4&#xff09;<\/td>\n<td>null<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8bf4\u660e&#xff1a;<\/p>\n<ul>\n<li>int,\u00a0short,\u00a0long,\u00a0byte\u00a0\u7684\u9ed8\u8ba4\u503c\u662f0\u3002<\/li>\n<li>char\u00a0\u7684\u9ed8\u8ba4\u503c\u662f\u00a0\\\\u0000&#xff08;\u7a7a\u5b57\u7b26&#xff09;\u3002<\/li>\n<li>float\u00a0\u7684\u9ed8\u8ba4\u503c\u662f\u00a00.0f\u3002<\/li>\n<li>double\u00a0\u7684\u9ed8\u8ba4\u503c\u662f\u00a00.0d\u3002<\/li>\n<li>boolean\u00a0\u7684\u9ed8\u8ba4\u503c\u662f\u00a0false\u3002<\/li>\n<li>\u5f15\u7528\u7c7b\u578b&#xff08;\u7c7b\u3001\u63a5\u53e3\u3001\u6570\u7ec4&#xff09;\u7684\u9ed8\u8ba4\u503c\u662f\u00a0null\u3002<\/li>\n<\/ul>\n<h3>\u5b9e\u4f8b<\/h3>\n<p>public class Test { static boolean bool; static byte by; static char ch; static double d; static float f; static int i; static long l; static short sh; static String str; public static void main(String[] args) { System.out.println(&#034;Bool :&#034; &#043; bool); System.out.println(&#034;Byte :&#034; &#043; by); System.out.println(&#034;Character:&#034; &#043; ch); System.out.println(&#034;Double :&#034; &#043; d); System.out.println(&#034;Float :&#034; &#043; f); System.out.println(&#034;Integer :&#034; &#043; i); System.out.println(&#034;Long :&#034; &#043; l); System.out.println(&#034;Short :&#034; &#043; sh); System.out.println(&#034;String :&#034; &#043; str); } }<\/p>\n<p>\u5b9e\u4f8b\u8f93\u51fa\u7ed3\u679c\u4e3a&#xff1a;<\/p>\n<p>Bool     :false<br \/>\nByte     :0<br \/>\nCharacter:<br \/>\nDouble   :0.0<br \/>\nFloat    :0.0<br \/>\nInteger  :0<br \/>\nLong     :0<br \/>\nShort    :0<br \/>\nString   :null <\/p>\n<hr \/>\n<h3>\u5f15\u7528\u7c7b\u578b<\/h3>\n<ul>\n<li>\u5728Java\u4e2d&#xff0c;\u5f15\u7528\u7c7b\u578b\u7684\u53d8\u91cf\u975e\u5e38\u7c7b\u4f3c\u4e8eC\/C&#043;&#043;\u7684\u6307\u9488\u3002\u5f15\u7528\u7c7b\u578b\u6307\u5411\u4e00\u4e2a\u5bf9\u8c61&#xff0c;\u6307\u5411\u5bf9\u8c61\u7684\u53d8\u91cf\u662f\u5f15\u7528\u53d8\u91cf\u3002\u8fd9\u4e9b\u53d8\u91cf\u5728\u58f0\u660e\u65f6\u88ab\u6307\u5b9a\u4e3a\u4e00\u4e2a\u7279\u5b9a\u7684\u7c7b\u578b&#xff0c;\u6bd4\u5982 Employee\u3001Puppy \u7b49\u3002\u53d8\u91cf\u4e00\u65e6\u58f0\u660e\u540e&#xff0c;\u7c7b\u578b\u5c31\u4e0d\u80fd\u88ab\u6539\u53d8\u4e86\u3002<\/li>\n<li>\u5bf9\u8c61\u3001\u6570\u7ec4\u90fd\u662f\u5f15\u7528\u6570\u636e\u7c7b\u578b\u3002<\/li>\n<li>\u6240\u6709\u5f15\u7528\u7c7b\u578b\u7684\u9ed8\u8ba4\u503c\u90fd\u662fnull\u3002<\/li>\n<li>\u4e00\u4e2a\u5f15\u7528\u53d8\u91cf\u53ef\u4ee5\u7528\u6765\u5f15\u7528\u4efb\u4f55\u4e0e\u4e4b\u517c\u5bb9\u7684\u7c7b\u578b\u3002<\/li>\n<li>\u4f8b\u5b50&#xff1a;Site site &#061; new Site(&#034;Runoob&#034;)\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>Java \u5e38\u91cf<\/h3>\n<p>\u5e38\u91cf\u5728\u7a0b\u5e8f\u8fd0\u884c\u65f6\u662f\u4e0d\u80fd\u88ab\u4fee\u6539\u7684\u3002<\/p>\n<p>\u5728 Java \u4e2d\u4f7f\u7528 final \u5173\u952e\u5b57\u6765\u4fee\u9970\u5e38\u91cf&#xff0c;\u58f0\u660e\u65b9\u5f0f\u548c\u53d8\u91cf\u7c7b\u4f3c&#xff1a;<\/p>\n<p>final double PI &#061; 3.1415927; <\/p>\n<p>\u867d\u7136\u5e38\u91cf\u540d\u4e5f\u53ef\u4ee5\u7528\u5c0f\u5199&#xff0c;\u4f46\u4e3a\u4e86\u4fbf\u4e8e\u8bc6\u522b&#xff0c;\u901a\u5e38\u4f7f\u7528\u5927\u5199\u5b57\u6bcd\u8868\u793a\u5e38\u91cf\u3002<\/p>\n<p>\u5b57\u9762\u91cf\u53ef\u4ee5\u8d4b\u7ed9\u4efb\u4f55\u5185\u7f6e\u7c7b\u578b\u7684\u53d8\u91cf\u3002\u4f8b\u5982&#xff1a;<\/p>\n<p>byte a &#061; 68;<br \/>\nchar a &#061; &#039;A&#039; <\/p>\n<p>byte\u3001int\u3001long\u3001\u548cshort\u90fd\u53ef\u4ee5\u7528\u5341\u8fdb\u5236\u300116\u8fdb\u5236\u4ee5\u53ca8\u8fdb\u5236\u7684\u65b9\u5f0f\u6765\u8868\u793a\u3002<\/p>\n<p>\u5f53\u4f7f\u7528\u5b57\u9762\u91cf\u7684\u65f6\u5019&#xff0c;\u524d\u7f00\u00a00\u00a0\u8868\u793a 8 \u8fdb\u5236&#xff0c;\u800c\u524d\u7f00\u00a00x\u00a0\u4ee3\u8868 16 \u8fdb\u5236, \u4f8b\u5982&#xff1a;<\/p>\n<p>int decimal &#061; 100;<br \/>\nint octal &#061; 0144;<br \/>\nint hexa &#061;  0x64; <\/p>\n<p>\u548c\u5176\u4ed6\u8bed\u8a00\u4e00\u6837&#xff0c;Java\u7684\u5b57\u7b26\u4e32\u5e38\u91cf\u4e5f\u662f\u5305\u542b\u5728\u4e24\u4e2a\u5f15\u53f7\u4e4b\u95f4\u7684\u5b57\u7b26\u5e8f\u5217\u3002\u4e0b\u9762\u662f\u5b57\u7b26\u4e32\u578b\u5b57\u9762\u91cf\u7684\u4f8b\u5b50&#xff1a;<\/p>\n<p>&#034;Hello World&#034;<br \/>\n&#034;two\\\\nlines&#034;<br \/>\n&#034;\\\\&#034;This is in quotes\\\\&#034;&#034; <\/p>\n<p>\u5b57\u7b26\u4e32\u5e38\u91cf\u548c\u5b57\u7b26\u53d8\u91cf\u90fd\u53ef\u4ee5\u5305\u542b\u4efb\u4f55 Unicode \u5b57\u7b26\u3002\u4f8b\u5982&#xff1a;<\/p>\n<p>char a &#061; &#039;\\\\u0001&#039;;<br \/>\nString a &#061; &#034;\\\\u0001&#034;; <\/p>\n<p>Java\u8bed\u8a00\u652f\u6301\u4e00\u4e9b\u7279\u6b8a\u7684\u8f6c\u4e49\u5b57\u7b26\u5e8f\u5217\u3002<\/p>\n<table>\n<tbody>\n<tr>\u7b26\u53f7\u5b57\u7b26\u542b\u4e49<\/tr>\n<tr>\n<td>\\\\n<\/td>\n<td>\u6362\u884c (0x0a)<\/td>\n<\/tr>\n<tr>\n<td>\\\\r<\/td>\n<td>\u56de\u8f66 (0x0d)<\/td>\n<\/tr>\n<tr>\n<td>\\\\f<\/td>\n<td>\u6362\u9875\u7b26(0x0c)<\/td>\n<\/tr>\n<tr>\n<td>\\\\b<\/td>\n<td>\u9000\u683c (0x08)<\/td>\n<\/tr>\n<tr>\n<td>\\\\0<\/td>\n<td>\u7a7a\u5b57\u7b26 (0x0)<\/td>\n<\/tr>\n<tr>\n<td>\\\\s<\/td>\n<td>\u7a7a\u683c (0x20)<\/td>\n<\/tr>\n<tr>\n<td>\\\\t<\/td>\n<td>\u5236\u8868\u7b26<\/td>\n<\/tr>\n<tr>\n<td>\\\\&#034;<\/td>\n<td>\u53cc\u5f15\u53f7<\/td>\n<\/tr>\n<tr>\n<td>\\\\&#039;<\/td>\n<td>\u5355\u5f15\u53f7<\/td>\n<\/tr>\n<tr>\n<td>\\\\\\\\<\/td>\n<td>\u53cd\u659c\u6760<\/td>\n<\/tr>\n<tr>\n<td>\\\\ddd<\/td>\n<td>\u516b\u8fdb\u5236\u5b57\u7b26 (ddd)<\/td>\n<\/tr>\n<tr>\n<td>\\\\uxxxx<\/td>\n<td>16\u8fdb\u5236Unicode\u5b57\u7b26 (xxxx)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h4>\u81ea\u52a8\u7c7b\u578b\u8f6c\u6362<\/h4>\n<p>\u6574\u578b\u3001\u5b9e\u578b&#xff08;\u5e38\u91cf&#xff09;\u3001\u5b57\u7b26\u578b\u6570\u636e\u53ef\u4ee5\u6df7\u5408\u8fd0\u7b97\u3002\u8fd0\u7b97\u4e2d&#xff0c;\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u636e\u5148\u8f6c\u5316\u4e3a\u540c\u4e00\u7c7b\u578b&#xff0c;\u7136\u540e\u8fdb\u884c\u8fd0\u7b97\u3002<\/p>\n<p>\u8f6c\u6362\u4ece\u4f4e\u7ea7\u5230\u9ad8\u7ea7\u3002<\/p>\n<p>\u4f4e  &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&gt;  \u9ad8<\/p>\n<p>byte,short,char\u2014&gt; int \u2014&gt; long\u2014&gt; float \u2014&gt; double  <\/p>\n<p>\u6570\u636e\u7c7b\u578b\u8f6c\u6362\u5fc5\u987b\u6ee1\u8db3\u5982\u4e0b\u89c4\u5219&#xff1a;<\/p>\n<ul>\n<li>\n<p>1. \u4e0d\u80fd\u5bf9boolean\u7c7b\u578b\u8fdb\u884c\u7c7b\u578b\u8f6c\u6362\u3002<\/p>\n<\/li>\n<li>\n<p>2. \u4e0d\u80fd\u628a\u5bf9\u8c61\u7c7b\u578b\u8f6c\u6362\u6210\u4e0d\u76f8\u5173\u7c7b\u7684\u5bf9\u8c61\u3002<\/p>\n<\/li>\n<li>\n<p>3. \u5728\u628a\u5bb9\u91cf\u5927\u7684\u7c7b\u578b\u8f6c\u6362\u4e3a\u5bb9\u91cf\u5c0f\u7684\u7c7b\u578b\u65f6\u5fc5\u987b\u4f7f\u7528\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u3002<\/p>\n<\/li>\n<li>\n<p>4. \u8f6c\u6362\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u5bfc\u81f4\u6ea2\u51fa\u6216\u635f\u5931\u7cbe\u5ea6&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<p> int i &#061;128;<br \/>\nbyte b &#061; (byte)i; <\/p>\n<p>\u56e0\u4e3a byte \u7c7b\u578b\u662f 8 \u4f4d&#xff0c;\u6700\u5927\u503c\u4e3a127&#xff0c;\u6240\u4ee5\u5f53 int \u5f3a\u5236\u8f6c\u6362\u4e3a byte \u7c7b\u578b\u65f6&#xff0c;\u503c 128 \u65f6\u5019\u5c31\u4f1a\u5bfc\u81f4\u6ea2\u51fa\u3002<\/p>\n<\/li>\n<li>\n<p>5. \u6d6e\u70b9\u6570\u5230\u6574\u6570\u7684\u8f6c\u6362\u662f\u901a\u8fc7\u820d\u5f03\u5c0f\u6570\u5f97\u5230&#xff0c;\u800c\u4e0d\u662f\u56db\u820d\u4e94\u5165&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<p> (int)23.7 &#061;&#061; 23;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<br \/>\n(int)-45.89f &#061;&#061; -45 <\/li>\n<\/ul>\n<h4>\u81ea\u52a8\u7c7b\u578b\u8f6c\u6362<\/h4>\n<p>\u5fc5\u987b\u6ee1\u8db3\u8f6c\u6362\u524d\u7684\u6570\u636e\u7c7b\u578b\u7684\u4f4d\u6570\u8981\u4f4e\u4e8e\u8f6c\u6362\u540e\u7684\u6570\u636e\u7c7b\u578b&#xff0c;\u4f8b\u5982: short\u6570\u636e\u7c7b\u578b\u7684\u4f4d\u6570\u4e3a16\u4f4d&#xff0c;\u5c31\u53ef\u4ee5\u81ea\u52a8\u8f6c\u6362\u4f4d\u6570\u4e3a32\u7684int\u7c7b\u578b&#xff0c;\u540c\u6837float\u6570\u636e\u7c7b\u578b\u7684\u4f4d\u6570\u4e3a32&#xff0c;\u53ef\u4ee5\u81ea\u52a8\u8f6c\u6362\u4e3a64\u4f4d\u7684double\u7c7b\u578b\u3002<\/p>\n<h3>\u5b9e\u4f8b<\/h3>\n<p>public class ZiDongLeiZhuan{ public static void main(String[] args){ char c1&#061;&#039;a&#039;;\/\/\u5b9a\u4e49\u4e00\u4e2achar\u7c7b\u578b int i1 &#061; c1;\/\/char\u81ea\u52a8\u7c7b\u578b\u8f6c\u6362\u4e3aint System.out.println(&#034;char\u81ea\u52a8\u7c7b\u578b\u8f6c\u6362\u4e3aint\u540e\u7684\u503c\u7b49\u4e8e&#034;&#043;i1); char c2 &#061; &#039;A&#039;;\/\/\u5b9a\u4e49\u4e00\u4e2achar\u7c7b\u578b int i2 &#061; c2&#043;1;\/\/char \u7c7b\u578b\u548c int \u7c7b\u578b\u8ba1\u7b97 System.out.println(&#034;char\u7c7b\u578b\u548cint\u8ba1\u7b97\u540e\u7684\u503c\u7b49\u4e8e&#034;&#043;i2); } }<\/p>\n<p>\u8fd0\u884c\u7ed3\u679c\u4e3a:<\/p>\n<p>char\u81ea\u52a8\u7c7b\u578b\u8f6c\u6362\u4e3aint\u540e\u7684\u503c\u7b49\u4e8e97<br \/>\nchar\u7c7b\u578b\u548cint\u8ba1\u7b97\u540e\u7684\u503c\u7b49\u4e8e66 <\/p>\n<p>\u89e3\u6790&#xff1a;c1 \u7684\u503c\u4e3a\u5b57\u7b26\u00a0a\u00a0,\u67e5 ASCII \u7801\u8868\u53ef\u77e5\u5bf9\u5e94\u7684 int \u7c7b\u578b\u503c\u4e3a 97&#xff0c; A \u5bf9\u5e94\u503c\u4e3a 65&#xff0c;\u6240\u4ee5\u00a0i2&#061;65&#043;1&#061;66\u3002<\/p>\n<h4>\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362<\/h4>\n<ul>\n<li>\n<p>1. \u6761\u4ef6\u662f\u8f6c\u6362\u7684\u6570\u636e\u7c7b\u578b\u5fc5\u987b\u662f\u517c\u5bb9\u7684\u3002<\/p>\n<\/li>\n<li>\n<p>2. \u683c\u5f0f&#xff1a;(type)value type\u662f\u8981\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u540e\u7684\u6570\u636e\u7c7b\u578b \u5b9e\u4f8b&#xff1a;<\/p>\n<h3>\u5b9e\u4f8b<\/h3>\n<p>public class ForceTransform { public static void main(String[] args){ int i1 &#061; 123; byte b &#061; (byte)i1;\/\/\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u4e3abyte System.out.println(&#034;int\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u4e3abyte\u540e\u7684\u503c\u7b49\u4e8e&#034;&#043;b); } }<\/p>\n<p>\u8fd0\u884c\u7ed3\u679c&#xff1a;<\/p>\n<p> int\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u4e3abyte\u540e\u7684\u503c\u7b49\u4e8e123 <\/li>\n<\/ul>\n<h4>\u9690\u542b\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362<\/h4>\n<ul>\n<li>\n<p>1\u3001 \u6574\u6570\u7684\u9ed8\u8ba4\u7c7b\u578b\u662f int\u3002<\/p>\n<\/li>\n<li>\n<p>2\u3001 \u5c0f\u6570\u9ed8\u8ba4\u662f double \u7c7b\u578b\u6d6e\u70b9\u578b&#xff0c;\u5728\u5b9a\u4e49 float \u7c7b\u578b\u65f6\u5fc5\u987b\u5728\u6570\u5b57\u540e\u9762\u8ddf\u4e0a F \u6216\u8005 f\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u8fd9\u4e00\u8282\u8bb2\u89e3\u4e86 Java \u7684\u57fa\u672c\u6570\u636e\u7c7b\u578b\u3002\u4e0b\u4e00\u8282\u5c06\u63a2\u8ba8\u4e0d\u540c\u7684\u53d8\u91cf\u7c7b\u578b\u4ee5\u53ca\u5b83\u4eec\u7684\u7528\u6cd5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53d8\u91cf\u5c31\u662f\u7533\u8bf7\u5185\u5b58\u6765\u5b58\u50a8\u503c\u3002\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u5f53\u521b\u5efa\u53d8\u91cf\u7684\u65f6\u5019&#xff0c;\u9700\u8981\u5728\u5185\u5b58\u4e2d\u7533\u8bf7\u7a7a\u95f4\u3002<br \/>\n\u5185\u5b58\u7ba1\u7406\u7cfb\u7edf\u6839\u636e\u53d8\u91cf\u7684\u7c7b\u578b\u4e3a\u53d8\u91cf\u5206\u914d\u5b58\u50a8\u7a7a\u95f4&#xff0c;\u5206\u914d\u7684\u7a7a\u95f4\u53ea\u80fd\u7528\u6765\u50a8\u5b58\u8be5\u7c7b\u578b\u6570\u636e\u3002 \u56e0\u6b64&#xff0c;\u901a\u8fc7\u5b9a\u4e49\u4e0d\u540c\u7c7b\u578b\u7684\u53d8\u91cf&#xff0c;\u53ef\u4ee5\u5728\u5185\u5b58\u4e2d\u50a8\u5b58\u6574\u6570\u3001\u5c0f\u6570\u6216\u8005\u5b57\u7b26\u3002<br \/>\nJava \u7684\u4e24\u5927\u6570\u636e\u7c7b\u578b:<br \/>\n\u5185\u7f6e\u6570\u636e\u7c7b\u578b\u5f15\u7528\u6570\u636e\u7c7b\u578b \u5185\u7f6e\u6570\u636e\u7c7b\u578b<br \/>\nJava\u8bed\u8a00\u63d0\u4f9b\u4e86\u516b\u79cd\u57fa\u672c\u7c7b\u578b\u3002\u516d\u79cd\u6570\u5b57\u7c7b\u578b&#xff08;\u56db\u4e2a\u6574\u6570\u578b&#xff0c;\u4e24\u4e2a\u6d6e\u70b9\u578b&amp;#xff<\/p>\n","protected":false},"author":2,"featured_media":64777,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,81,427],"topic":[],"class_list":["post-64778","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-python","tag-427"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java\u8bed\u8a00\u63d0\u4f9b\u4e86\u516b\u79cd\u57fa\u672c\u7c7b\u578b\u3010\u51fd\u6570\u548c\u57fa\u6570\u600e\u4e48\u5206\u522b\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/64778.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java\u8bed\u8a00\u63d0\u4f9b\u4e86\u516b\u79cd\u57fa\u672c\u7c7b\u578b\u3010\u51fd\u6570\u548c\u57fa\u6570\u600e\u4e48\u5206\u522b\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u53d8\u91cf\u5c31\u662f\u7533\u8bf7\u5185\u5b58\u6765\u5b58\u50a8\u503c\u3002\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u5f53\u521b\u5efa\u53d8\u91cf\u7684\u65f6\u5019&#xff0c;\u9700\u8981\u5728\u5185\u5b58\u4e2d\u7533\u8bf7\u7a7a\u95f4\u3002 \u5185\u5b58\u7ba1\u7406\u7cfb\u7edf\u6839\u636e\u53d8\u91cf\u7684\u7c7b\u578b\u4e3a\u53d8\u91cf\u5206\u914d\u5b58\u50a8\u7a7a\u95f4&#xff0c;\u5206\u914d\u7684\u7a7a\u95f4\u53ea\u80fd\u7528\u6765\u50a8\u5b58\u8be5\u7c7b\u578b\u6570\u636e\u3002 \u56e0\u6b64&#xff0c;\u901a\u8fc7\u5b9a\u4e49\u4e0d\u540c\u7c7b\u578b\u7684\u53d8\u91cf&#xff0c;\u53ef\u4ee5\u5728\u5185\u5b58\u4e2d\u50a8\u5b58\u6574\u6570\u3001\u5c0f\u6570\u6216\u8005\u5b57\u7b26\u3002 Java \u7684\u4e24\u5927\u6570\u636e\u7c7b\u578b: \u5185\u7f6e\u6570\u636e\u7c7b\u578b\u5f15\u7528\u6570\u636e\u7c7b\u578b \u5185\u7f6e\u6570\u636e\u7c7b\u578b Java\u8bed\u8a00\u63d0\u4f9b\u4e86\u516b\u79cd\u57fa\u672c\u7c7b\u578b\u3002\u516d\u79cd\u6570\u5b57\u7c7b\u578b&#xff08;\u56db\u4e2a\u6574\u6570\u578b&#xff0c;\u4e24\u4e2a\u6d6e\u70b9\u578b&amp;#xff\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/64778.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-23T19:48:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260123194817-6973d0813b53f.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/64778.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/64778.html\",\"name\":\"Java\u8bed\u8a00\u63d0\u4f9b\u4e86\u516b\u79cd\u57fa\u672c\u7c7b\u578b\u3010\u51fd\u6570\u548c\u57fa\u6570\u600e\u4e48\u5206\u522b\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-23T19:48:18+00:00\",\"dateModified\":\"2026-01-23T19:48:18+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/64778.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/64778.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/64778.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\u8bed\u8a00\u63d0\u4f9b\u4e86\u516b\u79cd\u57fa\u672c\u7c7b\u578b\u3010\u51fd\u6570\u548c\u57fa\u6570\u600e\u4e48\u5206\u522b\u3011\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java\u8bed\u8a00\u63d0\u4f9b\u4e86\u516b\u79cd\u57fa\u672c\u7c7b\u578b\u3010\u51fd\u6570\u548c\u57fa\u6570\u600e\u4e48\u5206\u522b\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/64778.html","og_locale":"zh_CN","og_type":"article","og_title":"Java\u8bed\u8a00\u63d0\u4f9b\u4e86\u516b\u79cd\u57fa\u672c\u7c7b\u578b\u3010\u51fd\u6570\u548c\u57fa\u6570\u600e\u4e48\u5206\u522b\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u53d8\u91cf\u5c31\u662f\u7533\u8bf7\u5185\u5b58\u6765\u5b58\u50a8\u503c\u3002\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u5f53\u521b\u5efa\u53d8\u91cf\u7684\u65f6\u5019&#xff0c;\u9700\u8981\u5728\u5185\u5b58\u4e2d\u7533\u8bf7\u7a7a\u95f4\u3002 \u5185\u5b58\u7ba1\u7406\u7cfb\u7edf\u6839\u636e\u53d8\u91cf\u7684\u7c7b\u578b\u4e3a\u53d8\u91cf\u5206\u914d\u5b58\u50a8\u7a7a\u95f4&#xff0c;\u5206\u914d\u7684\u7a7a\u95f4\u53ea\u80fd\u7528\u6765\u50a8\u5b58\u8be5\u7c7b\u578b\u6570\u636e\u3002 \u56e0\u6b64&#xff0c;\u901a\u8fc7\u5b9a\u4e49\u4e0d\u540c\u7c7b\u578b\u7684\u53d8\u91cf&#xff0c;\u53ef\u4ee5\u5728\u5185\u5b58\u4e2d\u50a8\u5b58\u6574\u6570\u3001\u5c0f\u6570\u6216\u8005\u5b57\u7b26\u3002 Java \u7684\u4e24\u5927\u6570\u636e\u7c7b\u578b: \u5185\u7f6e\u6570\u636e\u7c7b\u578b\u5f15\u7528\u6570\u636e\u7c7b\u578b \u5185\u7f6e\u6570\u636e\u7c7b\u578b Java\u8bed\u8a00\u63d0\u4f9b\u4e86\u516b\u79cd\u57fa\u672c\u7c7b\u578b\u3002\u516d\u79cd\u6570\u5b57\u7c7b\u578b&#xff08;\u56db\u4e2a\u6574\u6570\u578b&#xff0c;\u4e24\u4e2a\u6d6e\u70b9\u578b&amp;#xff","og_url":"https:\/\/www.wsisp.com\/helps\/64778.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-23T19:48:18+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260123194817-6973d0813b53f.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"8 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/64778.html","url":"https:\/\/www.wsisp.com\/helps\/64778.html","name":"Java\u8bed\u8a00\u63d0\u4f9b\u4e86\u516b\u79cd\u57fa\u672c\u7c7b\u578b\u3010\u51fd\u6570\u548c\u57fa\u6570\u600e\u4e48\u5206\u522b\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-23T19:48:18+00:00","dateModified":"2026-01-23T19:48:18+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/64778.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/64778.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/64778.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Java\u8bed\u8a00\u63d0\u4f9b\u4e86\u516b\u79cd\u57fa\u672c\u7c7b\u578b\u3010\u51fd\u6570\u548c\u57fa\u6570\u600e\u4e48\u5206\u522b\u3011"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/64778","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=64778"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/64778\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/64777"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=64778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=64778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=64778"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=64778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}