Category Java
Static Method in Java (with Examples)

When a method is declared with the keyword static in its heading, it is called a static method in Java. If not, it is called non-static (or instance) method. A static method is also known as class method because, like…
Static Variable in Java (with Examples)

In this tutorial, we will learn about the static keyword, and static variable in Java with the help of various example programs. Generally, when we create a class in Java, we don’t know anything about its members until we create…
Instance Block in Java | Types, Example

In this tutorial, we will learn about instance initialization block in Java with the help of examples. Before going to understand it, let us first understand what is a block in Java. A block in Java is a set of…
Non Access Modifiers in Java

In this tutorial, we will understand all non-access modifiers available in Java. We know that access modifiers such as private, default, protected, and public restrict the visibility (accessibility) of classes, fields, methods, or constructors in Java. These access modifiers basically…
Main Method in Java: Syntax, Example

A main method in Java is an entry point to start the execution of a program. Every Java application has at least one class and at least one main method. Normally, an application consists of many classes and only one…