型
基本型
void | 型なし | - | - | bool | ブール値 | 実行環境で変わる | false |
byte ubyte uint8 u8 | 符号無し8bit整数 | 1 | 0 |
sbyte sint8 s8 | 符号有り8bit整数 | 1 | 0 |
short sshort sint16 s16 | 符号有り16bit整数 | 2 | 0 |
ushort uint16 u16 | 符号無し16bit整数 | 2 | 0 |
int sint sint32 s32 | 符号有り32bit整数 | 4 | 0 |
uint uint32 u32 | 符号無し32bit整数 | 4 | 0 |
long slong sint64 s64 | 符号有り64bit整数 | 8 | 0 |
ulong uint64 u64 | 符号無し64bit整数 | 8 | 0 |
float float32 f32 | 32bit浮動小数点数 | 4 | 0 |
double float64 f64 | 64bit浮動小数点数 | 8 | 0 |
wchar | 16bit文字列(UTF-16) | 2 | 0x0000 |
dchar | 32bit文字列(UTF-32) | 4 | 0x000000000 |
object | ガベージコレクト対象のオブジェクトの参照 (class の基底クラス) | 実行環境で変わる | null |
pointer | 非ガベージコレクト対象のデータのポインタ | 実行環境で変わる | null |
構造データ型
ユーザー定義型
- class
- enum
- interface
- struct
- pod
- utility
object
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
-
|
|
-
|
|
!
|
|
|
|
-
|
|
|
|
|
|
|
-
!
|
|
|
|
|
-
!
|
|
|
-
!
|
|
|
|
|
!
|
|
!
| #spanend
#spanadd
class Sample
#spanend
#spanadd
{
#spanend
class Pos
{
int x;
int y;
};
#spanadd
#spanend
static void Example()
{
Pos pos1 = new Pos();
Pos pos2;
pos2 = pos1;
pos1.x = 2;
if ( pos2 is null )
{
}
#spanadd
#spanend
if ( pos1 is pos2 )
{
}
if ( pos1 !is null )
{
}
#spanadd
#spanend
int@ intVal = new int();
}
#spanadd
};
#spanend
#spanadd
|
bool
暗黙の変換
算術計算の変換
デリゲート
|