C#C
C#3y ago
Dinny

can someone help me with my abstract class

I've created my abstract classes and no we can't make instances of them, but i keep getting errors even after following youtube videos to the t.

here's my first file using abstract classes
namespace Module_9
{
    public abstract class RailroadCar
    {
        //data fields
        protected double length;

        //constr
        protected RailroadCar(double length = 0.00)
        {
            SetLength(length);
        }

        //GETTERS
        /** Returns length of solid.
            @return: solid length
        */
        public double GetLength(double length) { return length; }

        /** Updates length of solid.
            @return: updated length.
        */
        //SETTERS
        public void SetLength(double length) { this.length = length;}

        /** Calculates the volume of the solid.
            @return: calculated volume of the solid
        */
        public abstract double Volume();
    }
}
Was this page helpful?