Table of Contents
Java program to implement multiple inheritance
A Java program to implement multiple inheritance
Program to implement multiple inheritance in Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | interface Mobile { void brand(); void model(); void processor(); } class Nokia implements Mobile { public void brand() { System.out.println("nBrand : Nokia"); } public void model() { System.out.println("Model : Nokia 9.1 PureView"); } public void processor() { System.out.println("Processor : Snapdragon 855"); } } //itvoyagers.in class Samsung implements Mobile { public void brand() { System.out.println("nBrand : Samsung"); } public void model() { System.out.println("Model : Note 10"); } public void processor() { System.out.println("Processor : Exynos 9810 octa core processor"); } } //itvoyagers.in class InterfaceDemo { public static void main(String[] args) { Nokia nokia = new Nokia(); nokia.brand(); nokia.model(); nokia.processor(); Samsung samsung = new Samsung(); samsung.brand(); samsung.model(); samsung.processor(); } } |
Output

PRACTICALS/PRACTICE PROGRAM IN Java
CHECKOUT OTHER RELATED TOPICS
We are aiming to explain all concepts of Java in easiest terms as possible.

ITVoyagers
Author