Hi friends,i would like to share some important points about abstract classes and abstract methods with example
1)Abstract is a keyword which can be used with methods and classes
2)whenever a class is not providing full functionality then recommended to declare that class as "Abstract Class"
3)we cannot create a object of abstract class
name n=new name();//object is not possible
name n;//reference is possible
4)Refernce works with the help of chile class
name n=new gender();
5)abstract classes are similar to interfaces ,After declaring an abstract class,it cannot be instantiated on its own ,
it must be inhertited
6)a method without body is called as abstract method
syntax : public abstract void findNumber();
7)Abstract method is also called as Rule
8)when a class contains atleast one abstract method ,then that class must he declard as abstract
9)All the methods must be override in derived classes.
10)Abstract classes provides a set of rules (Abstract methods)which must be followed in derived(overrided)
11)Abstract classes are not instantitable but a reference can be created.
12)In VB.net,abstract classes are created using "MustInherit" keyword.In C# we have "Abstract "implemented in the child class.
Example program on Abstract classes and abstract methods
abstract class shape
privates int x=3,y=5;
public void print()
public abstract void findarea();
private int r=10;
public override void findarea()
public void display()
code for button click
circle c=new circle();
//shape s=new shape();-->its show an error
shape s=new circle();