초기 커밋.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,48 @@
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
|
||||
//리터널
|
||||
/*
|
||||
123 // int 리터럴
|
||||
12.3 // double 리터럴
|
||||
"A" // string 리터럴
|
||||
'a' // char 리터럴
|
||||
true // bool 리터럴
|
||||
*/
|
||||
|
||||
// Bool
|
||||
bool b = true;
|
||||
|
||||
// Numeric
|
||||
short sh = -32768;
|
||||
int i = 2147483647;
|
||||
long l = 1234L; // L suffix
|
||||
float f = 123.45F; // F suffix
|
||||
double d1 = 123.45;
|
||||
double d2 = 123.45D; // D suffix
|
||||
decimal d = 123.45M; // M suffix
|
||||
|
||||
// Char/String
|
||||
char c = 'A';
|
||||
string s = "Hello";
|
||||
|
||||
// DateTime 2011-10-30 12:35
|
||||
DateTime dt = new DateTime(2011, 10, 30, 12, 35, 0);
|
||||
|
||||
//최대 최소
|
||||
int iMax = int.MaxValue;
|
||||
float fMin = float.MinValue;
|
||||
|
||||
//null
|
||||
string sn;
|
||||
sn = null;
|
||||
|
||||
// Nullable 타입
|
||||
int? inl = null;
|
||||
inl = 101;
|
||||
|
||||
bool? bnl = null;
|
||||
|
||||
//int? 를 int로 할당
|
||||
Nullable<int> j = null;
|
||||
j = 10;
|
||||
int k = j.Value;
|
||||
Reference in New Issue
Block a user