Series: Abstract classes Interfaces

Java Abstract classes and Interfaces

Java Abstract Class Tutorial Example

Java Abstract Class Tutorial Example Summary: By the end of this tutorial "Java Abstract Class Tutorial Example", you will be comfortable to practice abstract methods and abstract classes. abstract Modifier You have seen earlier two access modifiers – static and final. Now let us go for another modifier "abstract". "abstract" modifier (and also keyword) can …

Java Abstract Class Tutorial Example Read More »

Java Made Clear: Difference between Abstract class Interface

Difference Abstract class Interface Summary: By the end of this tutorial" Difference Abstract class Interface", you will be comfortable to their differences. Introduction A novice feels why both abstract class and interface are required in Java as an abstract class can contain all abstract methods also. The main difference just on the face is Interface …

Java Made Clear: Difference between Abstract class Interface Read More »

Interfaces Multiple Inheritance Java

We know earlier, Java does not support multiple inheritance, basically. But to support multiple inheritance, partially, Java introduced "interfaces". An interface is not altogether a new one for us; just it is a special flavor of abstract class where all methods are abstract. That is, an interface contains only abstract methods. Syntax of multiple inheritance …

Interfaces Multiple Inheritance Java Read More »

What is interface in Java with realtime Example?

Java interface realtime examples Summary: By the end of this tutorial "Java interface realtime examples", you know what is interface with realtime examples. Java interface realtime examples Interface differs from abstract class in that interface contains only abstract methods. All methods should be public and abstract; if just omitted by the Programmer by style, Java …

What is interface in Java with realtime Example? Read More »

Extend Multiple Classes Java

Extend Multiple Classes Java Summary: At the end of this tutorial you will understand the usage of Extend Multiple Classes Java in the code. We know earlier that Java does not support multiple inheritance but supports partially through interfaces. After extends there must be only one class of either concrete (non-abstract) or abstract. After implements …

Extend Multiple Classes Java Read More »

Multiple Interfaces Implements Java

Summary: At the end of this tutorial, you will be comfortable with Multiple Interfaces Implements usage. Looks difficult at the beginning, but put some patience and start reading. Do some small programs to understand still better. This is required for a Developer. Any doubts may be forwarded to me. As Java does not support direct …

Multiple Interfaces Implements Java Read More »

Static Polymorphism Dynamic Polymorphism

Static Polymorphism Dynamic Polymorphism Summary: By the end of this tutorial "Static Polymorphism Dynamic Polymorphism", you will understand their differences. Explained with programs in simple words. It is the continuation of previous program Difference: Static binding and Dynamic binding and knowledge of binding is very much required for better understanding this concept as binding leads …

Static Polymorphism Dynamic Polymorphism Read More »

Java Made Clear: Difference Static binding Dynamic binding

Difference Static binding Dynamic binding Java, being an OOPs language, supports both static binding and dynamic binding. Coming to our topic, a class may have overloaded and overridden methods. When to call which method is decided (binded) sometimes by compiler and sometimes by JVM at runtime. Why this disparity? Why Java is designed like this? …

Java Made Clear: Difference Static binding Dynamic binding Read More »

Java Dynamic Binding Dynamic Polymorphism

Static binding and static polymorphism is achieved through method overloading. Now let us go for dynamic polymorphism. Observe the following code. Program of Java Dynamic Binding Dynamic Polymorphism class Bird { public void eat() // I { System.out.println(“All birds eat”); } } class Peacock extends Bird { public void eat() // II { System.out.println(“Peacock eats …

Java Dynamic Binding Dynamic Polymorphism Read More »

Java Extends vs Implements

Java uses two keywords to inherit – extends and implements. The difference of them and their usage is trivial to understand. Introduction Java Extends vs Implements Go through the following combinations and rules one-by-one. Write small programs and practice. It is required to master them for a better Developer. 1. Inheritance between concrete (non-abstract) and …

Java Extends vs Implements Read More »