w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to call a non abstract method of an abstract class directly without deriving the abstract class?

No, as abstract class can not be instantiated by itself. You have to derive from it in order to be able to construct an instance.

 public abstract class Base {

   public void BaseMethod() {
   }
 }

 var bs = new Base();  //FAIL TO COPMILE

but..

 public class Derived : Base {

 }

 var bs = new Derived ();  //OK
 bs.BaseMethod(); //OK 




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.