Multiple inheritance in Java is achieved by implementing multiple interfaces.
Here's how you do it:
interface Barks {
void bark();
}
interface Walks {
void walk();
}
class Dog implements Barks, Walks {
public void bark() {
System.out.println("Bark!");
}
public void walk() {
System.out.println("I am walking!");
}
}
Dog dog = new Dog();
dog.bark(); // Bark!
dog.walk(); // I am walking!