K.A
2
Q:

c# warning CS0108

//warning CS0108
class Bicycle : Vehicle					//Subclass
  {
    public override void SpeedUp()		//Add 'override'
    {
      Speed += 5;
    }
  }
  
//error CS0506
class Vehicle							//Superclass
  {
    public virtual void SpeedUp()		//Add 'virtual'
      {
        Speed += 5;
      }
  }
3
	error CS0176: Member 'Forest.TreeFacts' cannot be accessed with 
	an instance reference; qualify it with a type name instead
    
/*	This usually means that you tried to reference a static 
	member from an instance, instead of from the class				*/
    
    
    Forest f = new Forest("Congo", "Tropical");

    Console.WriteLine(f.TreeFacts); //Causes Error
    Console.WriteLine(Forest.TreeFacts); //Fixxes Error
1

New to Communities?

Join the community