Edit

基本型 Edit

予約語説明サイズ(byte)初期値
void型なし--
boolブール値実行環境で変わるfalse
byte
ubyte
uint8
u8
符号無し8bit整数10
sbyte
sint8
s8
符号有り8bit整数10
short
sshort
sint16
s16
符号有り16bit整数20
ushort
uint16
u16
符号無し16bit整数20
int
sint
sint32
s32
符号有り32bit整数40
uint
uint32
u32
符号無し32bit整数40
long
slong
sint64
s64
符号有り64bit整数80
ulong
uint64
u64
符号無し64bit整数80
float
float32
f32
32bit浮動小数点数40
double
float64
f64
64bit浮動小数点数80
char8bit文字列(UTF-8)10x00
wchar16bit文字列(UTF-16)20x0000
dchar32bit文字列(UTF-32)40x000000000
objectガベージコレクト対象のオブジェクトの参照
(class の基底クラス)
実行環境で変わるnull
pointer非ガベージコレクト対象のデータのポインタ実行環境で変わるnull

構造データ型 Edit

  • 配列
  • 連想配列
  • デリゲート

ユーザー定義型 Edit

  • class
  • enum
  • interface
  • struct
  • pod
  • utility

object Edit

  • ガベージコレクト対象の型。
すべてを展開すべてを収束
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 
-
|
-
|
|
!
|
|
-
|
|
|
|
|
|
|
-
!
|
|
|
-
!
|
|
|
-
!
|
|
|
!
|
!
class Sample
{
  class Pos
  {
    int x;
    int y;
  };
 
  static void Example()
  {    
    Pos pos1 = new Pos(); // pos1にオブジェクトを割り当てる
    Pos pos2; // nullで初期化される
    pos2 = pos1; // pos2とpos1に指し示すオブジェクトが同じになる
    pos1.x = 2; // メンバのアクセスはpod,struct,classと同じようにアクセスできる
    
    // null チェックはこのように行う。D言語と同じ。
    if ( pos2 is null )
    {
    }
 
    // 同じかどうかもisを使う
    if ( pos1 is pos2 )
    {
    }
 
    // !is は != のようなもの。
    if ( pos1 !is null )
    {
    }
 
    // 組み込み型,pod型,struct型はnewできない!
    int@ intVal = new int(); // エラー
  }
 
};

bool Edit

暗黙の変換 Edit

算術計算の変換 Edit

デリゲート Edit


リロード   新規 下位ページ作成 編集 凍結 差分 添付 コピー 名前変更   ホーム 一覧 検索 最終更新 バックアップ リンク元   ヘルプ   最終更新のRSS
Last-modified: Thu, 29 Jul 2010 23:59:52 JST (5013d)