Home / Programs / Multiple inheritance in Java by interface
🚀 Programming Example

Multiple inheritance in Java by interface

👁 1,264 Views
💻 Practical Program
📘 Step Learning
Learn this program step-by-step with algorithm, source code, output and detailed explanation.

💻 Program Code

interface father1{

void name();
}

interface father2{
void age();
}

class MultipleInheritance implements father1,father2{

	public void name(){
		System.out.println("Mr. Raman");
		}

	public void age(){
		System.out.println("102");
		}

public static void main(String args[]){
MultipleInheritance obj = new MultipleInheritance();
obj.name();
obj.age();
 }
}
                        

🖥 Program Output

Mr. Raman
102
Press any key to continue . . .
                            
📚 Learning Subject

Master Programming Through Practical Examples

Improve your coding logic, problem-solving skills and programming confidence by practicing real-world examples with explanations.

🎯 How to learn from this example

First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.

🔥 Practice suggestion

Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.