執行的時候,我寫了下面的代碼在一個文本文件並將其保存爲Exercise1.java: import java.util.*;
public class Exercise1
{
public static void main(String[] args)
{
char myChar;
int myInt;
System.out.println(myChar);
期間從另一個人VB.net項目C#的一些代碼轉換,我曾經碰到過下面的代碼: Public Sub New(ByVal lbytModuleAddress As Byte, ByVal lbytRelayStateMask As Byte)
Dim lintCounter As Integer
mbytModuleAddress = lbytModuleAddress
在Java 我們需要轉換的雙(大內存大小),整數(在內存大小更小)時鑄造 int x = (int) 4.3;
但是在對象的情況下,如果父類是「哺乳動物」(小內存大小)和它的子類是「人」(因爲得到了更多的屬性,然後哺乳動物大內存大小) 然後 Mammal m = new Human(); //works without casting
,但從小到大的轉換 Human h = (Human)