Category Java
Behavior of Access Modifiers in Java Inheritance
Superclass members can be inherited to subclass provided they are eligible by access modifiers. The behavior of access modifiers in the case of inheritance in Java is as follows: 1. The private members of the superclass cannot be inherited to…
Control Statements in Java

In this tutorial, we will understand about the different types of control flow statements in Java and the best practices for using them. A simple Java program contains a set of statements that generally contain expressions and end with a…
Nested Interface in Java with Example

When an interface as a static member is declared inside a class or another interface, it is called nested interface in Java or member interface. Nested interface must be declared as public inside another interface. The nested interface can be…
Use of Interface in Java (with Example)

In the previous tutorial, we have known the basic of the interface in Java as well as its several advantages in utilizing the features of interfaces in general programming. In general, when we write a simple program, nobody may think…
Can We Override Static Method in Java

No, we cannot override static method in Java because a static method is resolved at compile time by Java compiler whereas, method overriding is resolved at runtime by JVM because objects are only available at runtime. We can declare static…