0 comments

Abstraction Class Error

                                              Abstraction Class Error 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication7
{
    abstract class Myclass
    {
        internal int x;//normal member can be used in abstract class but it is not useful because we cannot creat a object of abstract class
        internal abstract string s;//Error 1 The modifier 'abstract' is not valid on fields. Try using a property instead. in
        abstract string s1;//Error 1 The modifier 'abstract' is not valid on fields. Try using a property instead.
        abstract void Myclass()  //Error 1 'ConsoleApplication7.Myclass.Myclass()': virtual or abstract members cannot be private

                                //Error 2 'Myclass': member names cannot be the same as their enclosing type

      {

       }

    }
    class Program
    {
        static void Main(string[] args)
        {
           //( Myclass obj = new Myclass();)//Error 1 Cannot create an instance of the abstract class or interface 'ConsoleApplication7.Myclass'


        }
    }

}

 
Toggle Footer
Top