Abstract class,Interfaces and its implementations
Abstract class We need abstract class for the sense of simplicity.Learn it this way,suppose there is a college administration with over 100 of persons working in different sections namely,Head of department,teachers of diff. subjects,accounts department staff,mess staff,cleaners etc. Each have their own role in the college.But,here's the situation,what if the different department(classes) want the similar thing,for example,retrieving student info or getting the salary.We have to make method with similar motive,for each and every class we make,WHAT A WASTE!!! Abstract class comes to the rescue. Abstract class is nothing but a normal class with some restrictions. Well,these restrictions are: At least one of the method/s must be abstract. You cannot make an object of an abstract class,i.e.,no new keyword before the class name.But the sub-classes of an abstract class is allowed. An abstract method MUST NOT HAVE A BODY.For example:void...