Things all DevOps Engineer should know in Java: OOPS Basics

      Comments Off on Things all DevOps Engineer should know in Java: OOPS Basics

This tutorial will walk you through the basics of Java every DevOps Engineer should know with the OOPS concept.

Introduction :

Java is one of the most popular programming languages used to create Web applications and platforms.

This is very important for a DevOps Engineer should have a basic understanding of the want to write Shared Libraries for Automation since groovy because Groovy is a Java-syntax-compatible object-oriented programming language for the Java platform.

Key Things to Know:


Classes are collections of methods that contain all the behaviors.
Classes are a specification or blueprint which we can be used to create the actual objects [Perform operations]. Class doesn’t consume any space. Child classes can not have more than one parent class.


class ClassName {      
         // default constructor is hidden

Objects will do the actual operations in the program. Every object has its own behaviors. Objects are runtime concepts, it does not exist until our application runs. Static classes will be initialized when we run the program. An object will be initialized only when we use the keyword “new”.

It is important to know that the only possible way to access an object is through a reference variable.


A method(function) is basically a behavior. A class can contain many methods. It is in methods where the logics are written, data is manipulated and all the actions are executed.


If we don’t define a constructor we will have a constructor by default for every class. This is to construct objects, Constructor is only required if we need to initiate some variables at class initialization.

Constructor example :

public class Maven {
   public Maven(){
    Test = false   //initiate this variable at class initialization


class ClassName {
   ClassName() {

Example :

Note: Constructor we are not using in this example since we don’t initialize any variables at class initialization

Object-Oriented Programming Basics :

It gives code orientation. This is to organize the code better. It simplifies the software development and maintenance by providing some concepts.

Principles of OOPS :

There are four principles,

  • Inheritance
  • Polymorphism
  • Abstraction
  • Encapsulation

Sharing is caring!


I'm an IT professional having multiple years of experience in IT Infrastructure planning, System integrations, Project implementation, and delivery. DevOps Enthusiast skilled with broad ranges of technology adoption. Well versed with Cloud Computing and Application Service Offerings such as SaaS/PaaS/IaaS. Expert in aligning business goals, mission and process to architect innovative solutions and strategies.