Java is an Object Oriented Programming Language - HOW?

Overview

We often come across the fact that Java is an object-oriented programming(OOP) language. As a beginner, we learn this fact and move ahead but never think about how to prove this whether it is an object-oriented programming language or not. In this blog, we will see with a straightforward and simple example why Java is an object-oriented programming language

What is an object-oriented language

A programming language that uses the concepts of OOPs(concepts like Class, Object, Method, Abstraction, Encapsulation, Polymorphism, Inheritance, etc..) is called an object-oriented language. In Java, We use all these concepts. Now let's see a very basic example of Java which proves it is an OOPS language.

Basic Example - HelloWorld Program

When we start learning Java or most of the programming languages we start them with a HelloWorld program. In Java, this is the basic program that itself proves that Java is an OOPs language.

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello Java Techies");
    }

}

In the above code snippet, we can see the program has a class name HelloWorld:

public class HelloWorld

Another thing we have a main method - The entry Point of the program:

public static void main(String[] args) {
        System.out.println("Hello Java Techies");
    }

Every Java program needs an entry point to execute. main method is the Entry Point of the program and we can not define main method outside of a class hence it follows the OOPs pattern because we have a class inside that we have a method and the class as well as method both are the concept of OOPs. Thus, the very first simple program of Java proves the fact that Java is an OOP language.

Conclusion

We learned about the Object-Oriented structure of Java and in parallel to that we received slightly deep understanding of the fact - HOW JAVA IS AN OOP LANGUAGE