You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Interface and Abstract Class/readme.md
+6-2
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,12 @@
3
3
* Interface basically has two main components
4
4
- Constants (By default)
5
5
- Methods (They do not have data type)
6
-
* When we implement the **Interface** to a class then we nedd to define all the **methods** of the Interface.
6
+
* When we implement the **Interface** to a class then we need to define all the **methods** of the Interface.
7
7
8
8
# Abstract
9
-
* Abstract is similar to Interface. It is a class itself.
9
+
* It is any class having one or more abstract methods.
10
+
* Abstract is similar to Interface. The difference: Not all methods need to be over-ridden; common methods can be defined within the Abstract class itself.
11
+
* Objects of Abstract classes cannot be made. It can only be inherited.
12
+
* If one or more method is declared abstract, its class must also be abstract.
10
13
* When we extend an Abstract Class to a Class, we need to define all the **methods** defined in the Abstract Class else the derived class again should be Abstract.
14
+
* It can have final methods i.e. methods that cannot be over-ridden.
0 commit comments