Public Vector3 v1. Public Vector3 v2 {set; The get; }
V1 Set (1, 2, 3) V2. The Set (1, 2, 3)
Print (v1); Print 1, 2, 3 Print (v2); Print 0 0,
Why is v2 print 000, strives for the detailed explanation!
CodePudding user response:
This involves the c # syntax - attributes: V2 {set; The get; } Set is to set a value, the get is to get the value, so the v2 should return the value of the set set up inside, For example: Public int the name; Public int the Name { The set { Name=value; } The get { return name; } } Name="Hello"; The Console. Write (" the Name is: {0} ", Name);