Inner class in Java In this article, we are going to learn a special type of class which is known as the Inner class in Java. Let's start this tutorial with the definition of the inner class, then we'll look at the types of the inner class, and how to create and use them. What is Inner class in Java? An inner class is a class that is defined within another class. An inner class can be considered as a member of the outer class and like the other members, it can have any access specifier and can be declared as abstract or final. There are generally two types of inner class in java: Static inner class or Static class Non-Static Inner class Whenever the inner class is marked with the static keyword, it will be called a Static class in java. Otherwise non-static inner class. In this tutorial, we are going to discuss the non-static inner class in java, so whenever we refer to the inner class it means we are talking about the non-static inner c
Static class in Java In this article, we are going to study what is a Static class in java, how we can create it and the benefits of making a static class. Before starting our tutorial on the static class, we first want to briefly remind you that "What is static?" , static is a keyword in java which is used to define a static member. A static member-created only once for a class and referred directly by the class name itself, objects created by the class can also refer the static member but all the objects share the same reference as static member-created only once for a class. A static member can be: static variables, static methods, static block or static initialization block, and, static class In this article, we will learn all about the static class in java, and we will discuss the other static members in another article. So, let's start this tutorial with the de