87장 암시적으로 형식변환
암식적으로 형식변환 ? |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 암시적으로형식화된로컬변수
{
class Program
{
static void Main(string[] args)
{
//변수선언
int a = 10;
//nullable형식
int? b = null;
//암시적으로 형식화된 로컬변수
var i = 1234; //알아서 초기화되는 값으로 선언
var s = "1234";
//타입출력
Console.WriteLine("{0}", i.GetType()); //Int32
Console.WriteLine("{0}", s.GetType()); //string
}
}
}
http://msdn.microsoft.com/ko-kr/library/ms141260.aspx |