What is the difference between /// and #region in c#?

后端 未结 8 1966
隐瞒了意图╮
隐瞒了意图╮ 2021-02-13 03:57

What is the difference between ///

and #region ...#endregion statements in c#? Which one the best?

8条回答
  •  清酒与你
    2021-02-13 04:26

    /// -> can be used for some comments

    #region ...#endregion -> can be used to mark particular set of code to a region,easy to reffer

    #region MainMethod
    
            /// 
            /// Comments
            /// 
            static void Main()
            {
                //Your code
            } 
            #endregion
    

提交回复
热议问题