더블 클릭해서 실행하니 mono develop 가 뜨고 빌드 옵션을 Debug에서 Release로 바꾸고
빌드하니
띠용.. PE32 executable 이 뜬다.
~/ar/bin/Release$ file *
ar.exe: PE32 executable (GUI) Intel 80386 Mono/.Net assembly, for MS Windows
ar.exe.config: XML 1.0 document, UTF-8 Unicode (with BOM) text, with CRLF line terminators
ar.pdb: Microsoft Rosyln C# debugging symbols version 1.0
물론 윈도우에서 프로젝트 파일 자체를 그대로 전송해 왔기 때문에
Deub로 가면 아래와 같이 나오는데 pdb는 메시지가 조금 다른데 exe는 리눅스 상에서 인식하는 포맷이 동일하게 나온다.
~/ar/bin/Debug$ file *
ar.exe: PE32 executable (GUI) Intel 80386 Mono/.Net assembly, for MS Windows
ar.exe.config: XML 1.0 document, UTF-8 Unicode (with BOM) text, with CRLF line terminators
ar.pdb: MSVC program database ver 7.00, 512*115 bytes
그나저나 4.7의 모든 것 이라고 해놓고
WPF, WWF 그리고 제한된 WCF 그리고 제한된 ASP.NET 비동기 stack을 제외한... (야이!!!)
Everything in .NET 4.7exceptWPF,WWF, and withlimited WCFandlimited ASP.NET async stack.
case 2: When you override a member variable in a child class (actually its hiding, not overriding), which version of that variable will be called depends on the reference, the object, unlike method lookup.
In your sample code, variable a and b are not actually member variable, they are class variable since static. Lets change the sample code a bit, making the 'a' in class 'A' public and adding some test code in main.
즉, 변수는 override되는 것이 아니라 hiding되는 것이며 dynamic하게 lookup되는 것이 아닙니다. 한 마디로, B의 a는 A의 a를 그저 hiding하는 것이고 A의 a와는 별개의 변수이며, getA는 자기가 정의된 시점의 a를 a로 생각하게 됩니다. B의 a에 대해서는 아예 모르죠.
$ csc cons.cs
Microsoft (R) Visual C# Compiler version 3.6.0-4.20224.5 (ec77c100)
Copyright (C) Microsoft Corporation. All rights reserved.
error CS5001: Program does not contain a static 'Main' method suitable for an entry point
아래 코드를 테스트 하는데 너무 단순해서 그런가.. Child()와 Child() : base()의 실행 결과에 차이는 없다.
단순히 명시적으로 해주었을뿐 어짜피 부모 생성자 실행 후 자식 생성자를 실행 하는 것은 변하지 않기 때문일 듯.
using System;
class Program
{
class Parent
{
public Parent() {Console.WriteLine("부모 생성자");}
}
class Child:Parent
{
// public Child() : base()
public Child()
{
Console.WriteLine("자식 생성자");}
}
static void Main(string[] args)
{
Child child = new Child();
}
}
// Adds two integers and returns the result
/// <summary>
/// Adds two integers and returns the result.
/// </summary>
/// <returns>
/// The sum of two integers.
/// </returns>
/// <example>
/// <code>
/// int c = Math.Add(4, 5);
/// if (c > 10)
/// {
/// Console.WriteLine(c);
/// }
/// </code>
/// </example>
public static int Add(int a, int b)
{
// If any parameter is equal to the max value of an integer
// and the other is greater than zero
if ((a == int.MaxValue && b > 0) || (b == int.MaxValue && a > 0))
throw new System.OverflowException();
return a + b;
}
Console.WriteLine(1/2); // 0, 앞의 숫자로 암시적 캐스팅 되서 결과가 나오는 듯 Console.WriteLine("안녕하세요"[100]); // 에러는 발생하지만 이런식으로 변수가 생성 가능한 듯 Console.WriteLin('가'+'힣'); // 99235 char 형으로 인식해서 숫자로 되는 듯. "가" 로 하면 합쳐지려나?
일반 키워드 abstract as - effectc c# 에서는 시작 부분에 cast 대신 쓰라고 나오네? base bool break byte case catch char checked class const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long namespace new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using virtual void volatile while
컨텍스트 키워드 add alias ascending async await descending dynamic from get global group into join let orderby partial remove select set value var - js 등의 var와 동일한데 초기에 변수 형태가 정해지면 바꿀순 없음 where yield