extends Java Keyword Examples
abstract class Animals {
/** All kind of animals eat food so make this common to all animals. */
public void eat() {
System.out.println(" Eating ..........");
}
/** The make different sounds. They will provide their own implementation */
abstract void sound();
}
class Cat extends Animals {
@Override
void sound() {
System.out.println("Meoww Meoww ........");
}
}
class Dog extends Animals {
@Override
void sound() {
System.out.println("Woof Woof ........");
}
}
public interface A{
}
public interface B extends A {
}
Continue Learning with Java Guides
Want to take your programming skills to the next level? Explore my practical Udemy courses on Java, Spring Boot, Microservices, Full-Stack Development, Docker, and Generative AI. You can also follow my structured learning roadmaps to become a professional developer.
By Ramesh Fadatare - Udemy Instructor Partner
Comments
Post a Comment
Leave Comment