In an attempt to fully understand how to solve Java\'s multiple inheritance problems I have a classic question that I need clarified.
Lets say I have class Ani
To solve the problem of mutiple inheritance in Java → interface is used
J2EE (core JAVA) Notes By Mr. K.V.R Page 51
Day - 27
- Interfaces are basically used to develop user defined data types.
- With respect to interfaces we can achieve the concept of multiple inheritances.
- With interfaces we can achieve the concept of polymorphism, dynamic binding and hence we can improve the performance of a JAVA program in turns of memory space and execution time.
An interface is a construct which contains the collection of purely undefined methods or an interface is a collection of purely abstract methods.
[...]
Day - 28:
Syntax-1 for reusing the features of interface(s) to class:
[abstract] class
implements , ......... { variable declaration; method definition or declaration; }; In the above syntax clsname represents name of the class which is inheriting the features from ‘n’ number of interfaces. ‘Implements’ is a keyword which is used to inherit the features of interface(s) to a derived class.
[...]
Syntax-2 inheriting ‘n’ number of interfaces to another interface:
interface
extends , ......... { variable declaration cum initialization; method declaration; }; [...]
Syntax-3:
[abstract] class
extends implements , ......... { variable declaration; method definition or declaration; };