- 雙語版Java程序設(shè)計(jì)
- 何月順主編
- 178字
- 2018-12-27 20:14:12
3.2 Primitive Types
Let us make a couple quick notes about a couple of the data types as shown in table 3.1 before we continue. The char type is a Unicode character in Java, rather than an ASCII character, as most people are used to seeing. That means that any character (regardless of language) can be represented with a char variable. That’s why a char variable requires 2 bytes of storage rather than the 1 byte that is required for all ASCII characters. Also, you’ll notice in the sample initialization of the float variable the extra ‘f’ character. This is required because, by default, the Java compiler views all decimal literals as doubles. In order to place a double into a float, you need to do a cast. I’ll look at the reason for this next.
Java中字符類型屬于unicode編碼,每個(gè)字符占據(jù)2字節(jié)的存儲(chǔ)空間。
Table 3.1 Main primitive types in Java
- 虛擬儀器設(shè)計(jì)測控應(yīng)用典型實(shí)例
- 會(huì)聲會(huì)影X5視頻剪輯高手速成
- 自動(dòng)檢測與傳感技術(shù)
- 電腦上網(wǎng)直通車
- 最簡數(shù)據(jù)挖掘
- 21天學(xué)通Visual Basic
- 永磁同步電動(dòng)機(jī)變頻調(diào)速系統(tǒng)及其控制(第2版)
- Docker High Performance(Second Edition)
- INSTANT Autodesk Revit 2013 Customization with .NET How-to
- 大數(shù)據(jù)時(shí)代
- 悟透AutoCAD 2009完全自學(xué)手冊
- 在實(shí)戰(zhàn)中成長:C++開發(fā)之路
- C#求職寶典
- 機(jī)器人剛?cè)狁詈蟿?dòng)力學(xué)
- Linux常用命令簡明手冊