Static function in Abstract Class

It is very important questions for interview that can we have static method in Abstract Class? As we know that, we cannot create the object of Abstract class and static method cannot be called with object.

Therefore, we can create the static method in Abstract class and call it with the help of class name

Example

In the following example, we have created Abstract class Abc and static method with the name of data.


	
	public abstract class Abc
{
    public static  int data(int x, int y)
    {
        return (x + y);
    }
    
}


	

Now call this static function with the help of class name


	
	protected void Page_Load(object sender, EventArgs e)
    {
        Response.Write(Abc.data(3, 5));
    }