HTML

How to Rotate an Array to Left/Right by a Given Number in Java - Coding Problem

Hello guys, welcome to this post with another array based coding problem. In the last article, we've learned about finding missing numbers in the array with duplicates and today we'll solve the problem of rotating an array by left or right by a given number. For example, suppose an integer array {1, 2, 3} is given and it was asked to rate this array to the left by 3 then the result array will look like {2, 3, 1} because it was rotated twice on left. Similarly, if you are asked to rotate the same array twice by right then you'll get {1, 2, 3}, the same array is back. This is an interesting problem and it's quite easy to solve but I have seen many programmers struggle with this one as well. So, a little bit of practice and learning will not hurt.

5 Free DevOps Courses to learn Jenkins, Docker, and Kubernetes Online

Hello guys, you might have heard about DevOps and all the attention it is getting now. The DevOps is a new phenomenon and there is a mad race among senior developers to become a DevOps engineer. Well, I am not one of them as my passion is for becoming a software architect but I have certainly spent some time learning DevOps just to increase my knowledge of the field as I strongly believe in the phrase, jack of all and master of one :-). In DevOps world, tools matters a lot and whole of the DevOps phenomenon to create an automated pipeline for delivering a quality software heavily relies on cleaver uses of tools like Maven, Jenkins, Docker, Kubernetes, and others.

Java 8 Optional Example - isPresent(), OrElse() and get()

The Optional class in Java is one of many goodies we have got from the Java 8 release. If you use correctly, Optional can result in clean code and can also help you to avoid NullPointerException which has bothered Java developer from its inception. Even though many of us have used null to indicate the absence of something, the big problem is that if you call a method or access a field on the null object (except static fields), you will get a NullPointerException and your whole program may crash. The bigger problem is to find the faulty code or root cause because NullPointerException only indicates the line when you try to access field or variable from a null object but how does that null is get created on the code is unknown.