Overview of abstract and final class

Go down

Overview of abstract and final class

Post  Uma_ABAP on Sat Mar 31, 2012 11:44 pm


In class definition we have some more variation. The two variations are abstract and final, if
we add ABSTRACT and FINAL to the METHODS and CLASS statements then it allows us u
to define abstract and final methods or classes.

Lets discuss what are all these , if we declare a class as abstract then that class is not
implementable as well as it cannot be instantiated, but the what is the use of such class ??
Well this type of class are used in the concept of inheritance, the abstract class is only
implementable in its sub class.

Lets come to final, what is final?? These is also used with inheritance if we want to prevent a
class from being inherited then we do it by adding the word final to class definition final
class cannot be inherited and its methods cannot be redefined in the subclass.

Uma_ABAP

Posts : 56
Join date : 2012-03-31

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum