コード例 #1
0
            //initializing the class directly
            private static void Main2()
            {
                AutoImplementedProps autoImplementedProps = new AutoImplementedProps();

                autoImplementedProps.PlayerNumber = 3;
                //autoImplementedProps.FieldName = "ksdfjg"; // Problem setting the FieldNAme - Must use a constructor or factory method
            }
コード例 #2
0
 //initializing props through the constructor
 private static void Main()
 {
     AutoImplementedProps autoImplementedProps = new AutoImplementedProps(3, "Hello"); // No problem setting the FieldName
 }