Answers for "c# error CS0120"

C#
1

c# error CS0120

error CS0120: An object reference is required to access
		non-static field, method, or property 'Forest.Grow()'

/*		This usually means you tried to reference a non-static 
		member from a class, instead of from an instance			*/
          

        Forest f = new Forest("Congo", "Tropical");

        Forest.Grow(); //Causes error
		f.Grow(); //Fixes error
Posted by: Guest on March-05-2020

Code answers related to "c# error CS0120"

C# Answers by Framework

Browse Popular Code Answers by Language