Monday, January 31, 2022

3 Ways to change Embedded Tomcat Server Port in Spring Boot Application - Example

If you know Spring Boot really simplifies the Java web development by embedding essential libraries as well as a tomcat server to run Java web applications. By default, this tomcat server listens on port 4588, and for any reason, if you want to change, then Spring boot provides several configuration options to achieve that. For example, I wanted tomcat to listen on port 8080 because port 80 is forwarded to 8080 in our Linux machine, and we wanted our clients to provide our client with a clean URL without a port.

Sunday, January 30, 2022

Difference between @SpringBootApplication vs @EnableAutoConfiguration annotations in Spring Boot? Example

Even though both @SpringBootApplication and @EnableAutoConfiguration can be used to enable the auto-configuration feature of Spring Boot, there is a subtle difference between them. The @SpringBootApplication does much more than what @EnableAutoConfiguration does. It's actually a combination of three annotations: @Configuration, which is used in Java-based configuration on Spring framework, @ComponentScan to enable component scanning of components you write like @Controller classes, and @EnableAutoConfgiuration itself, which is used to allow for auto-configuration in Spring Boot application.

Friday, January 28, 2022

Decorator Design Pattern Example in Java [Tutorial]

The Decorator design pattern is one of the famous Gang of Four (GOF) structural design patterns, which provides a dynamic way of extending an object's functionality. It's different than the traditional way of adding new functionality into an object using Inheritance, instead, it uses Composition which makes it flexible and allows the addition of new functionalities at the run time, as opposite to Inheritance, which adds new functionality at compile time. Because of this flexibility, Decorator is one of the darling patterns for many Java developers. 

Difference between notify and notifyAll in Java? [Answered]

wait, notify, and notifyAll methods are used for inter-thread communication in Java. wait() allows a thread to check for a condition, and wait if the condition doesn't meet, while notifying() and notifyAll() method informs waiting for a thread for rechecking condition, after changing the state of a shared variable. One good example of how to wait and notify method works is the Producer consumer problem, where one thread produces and waits if the bucket is full; and another thread consumes and waits if the bucket is empty. 

Thursday, January 27, 2022

How to create a dynamic list in React? Example Tutorial

1. Introduction

Working with lists is common in React web development. Creating a static list is very easy but making it dynamic can be tough. Dynamic lists can generally be manipulated in one way or another. For example, a new item can be added to a list by entering a value in an input field or an item can be removed when it is clicked. 


In this tutorial, we will learn how to create a dynamic list in which a new item can be added through an input field. Moreover, we will learn how to delete an item when clicked.

Wednesday, January 26, 2022

How to Solve Producer Consumer Problem in Java using BlockingQueue [Example]

The Producer-Consumer problem is one of the classic multi-threading problems in computer science and the multi-threading world. It's tricky because it involves inter-thread communication, but it's important because most of the multi-threading problems fit into this category. Because of its importance, it's also known as Producer Consumer design patterns. There are many ways to solve the producer-consumer problem in Java, like you can solve this by using the wait() and notify() method, as discussed here, or you can use the Semaphore to solve this problem. 

Sunday, January 23, 2022

Difference between CountDownLatch vs CyclicBarrier in Java Multithreading

Difference between CountDownLatch and CyclicBarrier in Java
Both CyclicBarrier and CountDownLatch are used to implement a scenario where one Thread waits for one or more Thread to complete their job before starting processing but there is one difference between CountDownLatch and CyclicBarrier in Java which separates them apart and that is, you can not reuse the same CountDownLatch instance once count reaches to zero and latch is open, on the other hand, CyclicBarrier can be reused by resetting Barrier, Once the barrier is broken.

Friday, January 21, 2022

Top 3 Niche Programming Languages You can Learn in 2024

 Hello guys, if you are looking for programming languages to gain an edge over the competition then you have come to the right place. In the past, I have shared the best programming language for beginners, the best programming language for Data Science, the best programing language for web development, Cyber Security, App Development, and game development in this article, I am going to share 3 unique programming language which you can learn to distinguish your resume from others. I have chosen a combination of dynamic programming language, functional programming language, and something which is not very common and makes you a niche developer. 

Thursday, January 20, 2022

Java 8 - Map and Reduce Example Tutorial

Hello folks, the map-reduce concept is one of the powerful concepts in computer programming, particularly on functional programming which utilizes the power of distributed and parallel processing to solve a big and heavy problem in a quick time. From Java 8 onwards, Java also got this powerful feature from the functional programming world. Many of the services provided on the internet like Google Search are based on the concept of the map and reduce. In map-reduce, a job is usually split from the input data-set into independent chunks which are processed by the map tasks in a completely parallel manner. The framework then sorts the outputs of the map operation, which are then supplied to the reduce tasks.

Wednesday, January 19, 2022

How to convert Date to LocalDateTime in Java 8 - Example Tutorial

The LocalDateTime class has been introduced in Java 8 to represent both date and time values. It's local, so date and time are always in your local time zone. Since the java.util.Date has been widely used everywhere in many Java applications, you will often find yourself converting java.util.Date to LocalDate, LocalTime, and LocalDateTime classes of the java.time package. Earlier I have shown you how to convert Date to LocalDate and today, I am going to teach you how to convert Date to LocalDateTime in Java 8. The approach is the same. Since the equivalent class of java.util.Date in new Date and Time API in java.time.Instant, we first convert Date to Instance and then create LocalDateTime instance from that Instant using System's default timezone.

Thursday, January 13, 2022

Top 5 Free & Paid Spring Certification Courses and Practice Tests

Many Java developers don't know that, similar to Oracle's Java certification, there is also a Spring certification program, which certifies yourself for your Spring framework skill. There are three Spring certifications currently available, the Spring Professional certification exam, also known as the Vmware Certified Spring Professional exam (VMware EDU-1202) which certifies on your general knowledge about Spring framework, Spring MVC skill, Spring Boot, Spring Data JPA, Testing with Spring and Spring Boot, and other advanced Spring skills. Earlier, SpringSource provides these certifications, but now they are provided by Vmware, the company behind the Spring framework.

Wednesday, January 12, 2022

What is objects in JavaScript? Example Tutorial

JavaScript is a dynamically typed programming language. In JavaScript, it is not required to define the data type of a variable but that does not mean JavaScript does not have data types. Data types in JavaScript are divided into two categories - primitive and non-primitive.


Primitive data types such as numbers and strings can hold only a single value. But non-primitive types can hold more than one value. Objects in JavaScript are non-primitive. 


If you have ever done programming, you may be familiar with the concept of objects because objects are one of the most important parts of programming. The reason is simple. Objects can hold multiple values. In this article, we will discuss objects in JavaScript. 

Tuesday, January 11, 2022

How to Pass Spring Professional 5.0 Certification (VMware EDU-1202) [UPDATED]

Hello guys, if one of your new year goals is to pass the Spring Developer Certification this year and wondering where to start then you have come to the right place. In this, article, I'll tell you how to prepare for Spring Professional v 5.0 certification (VMware EDU-1202)  and useful resources to pass the exam on the first attempt. If you have been self-preparing for Spring Professional 5.0 exam, then you might have struggled with which topics to prepare and which topics to leave out. I often receive questions like does Spring Boot is part of Core Spring certification? Will there be any questions from Spring Security and Spring Data? Does Spring Cloud also part of this exam or not? Unfortunately, there is no detailed, semester syllabus for Vmware's Core Spring certification (VMware EDU-1202) 

Monday, January 10, 2022

5 Best books to Learn JDBC for Java Programmers

The JDBC (Java Database connectivity) is one of the vital API in the Java programming language which allows a Java program to connect to any database, like Oracle, Microsoft SQL Server, MySQL, PostgreSQL, SQL Lite, Sybase or any other relational database. It's an essential API to learn and master for both core Java and Java EE professionals, given the ubiquitous nature of Databases in real-world applications. Despite its importance, many Java developer lacks essential JDBC skills, like they are not familiar with Connection, Statement, connection pool, calling stored procedures, and executing a transaction in JDBC.

Sunday, January 9, 2022

Top 5 Resources to become a Certified Spring Developer Professional in 2024

Ever since Pivotal has announced that Spring training is not mandatory for becoming a Certified Spring developer (now VMware EDU-1202), more and more experienced Java programmers who have been using Spring for years are preparing for this certification exam. This is obvious because the expensive Spring training, which cost around 32000 USD in the USA and most Western nations and about 50,000 INR in India, was the biggest hurdle in getting Spring certified and becoming a certified Spring professional. 

Friday, January 7, 2022

Top 5 New Features Java Programmers should learn in 2024

Hello Java programmers, If you are wondering which new Java feature you should learn in 2024 then you have come to the right place. Earlier I have shared Java Developer RoadMap and essential Java Development framework and in this article, I am going to share the top 5 new Java features every Java developer should learn in 2024. This includes features like Record which can make creating value classes easier as well as Text Block, var, and many other features to improve your productivity. Java Programming language is changing rapidly. Now there is a new release every six months and it's hard to keep up-to-speed with new Java features. 

Thursday, January 6, 2022

Top 10 Frameworks & Libraries Programmers can Learn in 2024 [UPDATED]

Hello Guys, we are in the first week of 2024 now, and many of you might have already made your goals about what to learn in 2024, but if you haven't, then you have come to the right place. In this article, I share some of the best frameworks and libraries for web development, mobile app development, and big data, which an application developer can learn in 2024. The New Year will be all about Mobile App Development, Blockchain, Cloud Computing. Machine learning, and next-generation web with a greater focus on big data technologies like Hadoop and Spark.