C# Programming Language学习笔记(三)
生活随笔
收集整理的這篇文章主要介紹了
C# Programming Language学习笔记(三)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
第二章 詞法結構
The lexical grammar defines how Unicode characters are combined to form line terminators, white space, comments, tokens, and preprocessing directives. The syntactic grammar defines how the tokens resulting from the lexical grammar are combined to form C# programs.
詞法分析定義如何把Unicode字符聯合形成行,空白符,注釋,標記和預處理.語法分析定義如何把從詞法分析中得到的標記聯合形成C#程序.
詞法分析還是比較麻煩的一部分,等日后看編譯原理的時候再回來瞧瞧.
第三章 基礎概念
1.An application domain enables application isolation by acting as a container for application state. An application domain acts as a container and boundary for the types defined in the application and the class libraries it uses. Types loaded into one application domain are distinct from the same type loaded into another application domain, and instances of objects are not directly shared between application domains. For instance, each application domain has its own copy of static variables for these types, and a static constructor for a type runs at most once per application domain. Implementations are free to provide implementation-specific policy or mechanisms for creating and destroying application domains.
程序域作為應用程序的狀態容器把程序隔離.程序域是程序中定義類型和使用的類庫的容器和邊界.加載到一個程序域中的類型區別與加載到另一程序域的同一類型,并且對象的實例在程序域間不能直接共享.比如,每一個程序域都有它們類型的靜態變量的拷貝,并且一個類型的靜態構造器在程序域中至多只能運行一次.執行為創建和銷毀程序域自動提供具體的執行策略和機制.
2.Because C# supports method overloading, a class or struct can contain multiple definitions of some method, provided each has a different signature. However, within a single program, no class or struct can contain more than one method called Main whose definition qualifies it to be used as an application entry point. Other overloaded versions of Main are permitted, however, provided they have more than one parameter or their only parameter is other than type string[].
C#支持方法重載,一個類或結構可以包含一些方法的多次定義,只要具有不同的簽名.但是,在一個單獨的程序中,沒有類和結構能夠包含多于一個的定義為用來作程序入口的稱為Main的方法.其它重載版本的Main方法是允許的,但是,要保證它們要多于一個參數或者有一個參數,但類型不是string[].
3. Specifically, the execution environment can access the application's entry point regardless of its declared accessibility and regardless of the declared accessibility of its enclosing type declarations.
比較特殊的,執行環境總是可以訪問程序的入口,不管入口聲明的訪問級別也不管入口所屬類型的訪問級別是什么.
4.Prior to an application's termination, destructors for all of its objects that have not yet been garbage collected are called, unless such cleanup has been suppressed (by a call to the library method GC.SuppressFinalize, for example).
在程序終止之前,程序中所有沒有被垃圾回收器收集的對象的析構器會被調用,除非這些清理已經被強制執行過(比如,調用庫方法GC.SuppressFinalize).
The lexical grammar defines how Unicode characters are combined to form line terminators, white space, comments, tokens, and preprocessing directives. The syntactic grammar defines how the tokens resulting from the lexical grammar are combined to form C# programs.
詞法分析定義如何把Unicode字符聯合形成行,空白符,注釋,標記和預處理.語法分析定義如何把從詞法分析中得到的標記聯合形成C#程序.
詞法分析還是比較麻煩的一部分,等日后看編譯原理的時候再回來瞧瞧.
第三章 基礎概念
1.An application domain enables application isolation by acting as a container for application state. An application domain acts as a container and boundary for the types defined in the application and the class libraries it uses. Types loaded into one application domain are distinct from the same type loaded into another application domain, and instances of objects are not directly shared between application domains. For instance, each application domain has its own copy of static variables for these types, and a static constructor for a type runs at most once per application domain. Implementations are free to provide implementation-specific policy or mechanisms for creating and destroying application domains.
程序域作為應用程序的狀態容器把程序隔離.程序域是程序中定義類型和使用的類庫的容器和邊界.加載到一個程序域中的類型區別與加載到另一程序域的同一類型,并且對象的實例在程序域間不能直接共享.比如,每一個程序域都有它們類型的靜態變量的拷貝,并且一個類型的靜態構造器在程序域中至多只能運行一次.執行為創建和銷毀程序域自動提供具體的執行策略和機制.
2.Because C# supports method overloading, a class or struct can contain multiple definitions of some method, provided each has a different signature. However, within a single program, no class or struct can contain more than one method called Main whose definition qualifies it to be used as an application entry point. Other overloaded versions of Main are permitted, however, provided they have more than one parameter or their only parameter is other than type string[].
C#支持方法重載,一個類或結構可以包含一些方法的多次定義,只要具有不同的簽名.但是,在一個單獨的程序中,沒有類和結構能夠包含多于一個的定義為用來作程序入口的稱為Main的方法.其它重載版本的Main方法是允許的,但是,要保證它們要多于一個參數或者有一個參數,但類型不是string[].
3. Specifically, the execution environment can access the application's entry point regardless of its declared accessibility and regardless of the declared accessibility of its enclosing type declarations.
比較特殊的,執行環境總是可以訪問程序的入口,不管入口聲明的訪問級別也不管入口所屬類型的訪問級別是什么.
4.Prior to an application's termination, destructors for all of its objects that have not yet been garbage collected are called, unless such cleanup has been suppressed (by a call to the library method GC.SuppressFinalize, for example).
在程序終止之前,程序中所有沒有被垃圾回收器收集的對象的析構器會被調用,除非這些清理已經被強制執行過(比如,調用庫方法GC.SuppressFinalize).
轉載于:https://www.cnblogs.com/Farseer1215/archive/2005/10/19/258022.html
總結
以上是生活随笔為你收集整理的C# Programming Language学习笔记(三)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Hibernate 多对多映射实列
- 下一篇: VC6中工具条的新特色