Book Review - Is Effective Java 3rd Edition Really Worth It?

Hello guys, you might have heard about Effective Java, one of the most recommended books for Java programmers. This is one of those books which every Java developer wants to read because it will not teach you syntax but how and when to use a particular feature. After the huge success of Effective Java 1st Edition and 2nd Edition, the 3rd edition of Effective Java released a couple of years ago.  After 10 years of long wait by Java programmers from all over the world, finally, an updated version of, probably, the most popular Java book on the planet is released and I am going to talk about this new version of Effective Java, I mean Effective Java 3rd Edition in this article and share my thought that why its a must-read book for every Java developer around the world.

10 Best Practices for Handling Null in Java

Hello guys, Dealing with null is an inevitable part of Java programming, but following best practices can help you manage it effectively and write more reliable code. In this article, we'll explore ten best practices for handling null in Java to improve code quality and avoid common pitfalls. If you can handle null then you will sure write better code as null is often the cause of Runtime errors in Java, you may heard of NullPointerException? No. If not then I can say that you have not coded enough in Java because it was the first error I got when I start writing Java program in my college days. At that time I don't know how to handle null better so it's long painful debugging until we find the cause and then do some workaround or fix but if you know how to handle null better then you can write code which can withstand test of time in production. 

10 Common Coding Mistakes Every Java Developers Should be aware of

Hello guys, Java is a versatile and powerful programming language, but it's not immune to common coding mistakes that developers may inadvertently make. These errors can lead to unexpected behavior, performance issues, and even security vulnerabilities. In this article, I am going to share 10 such common coding mistakes Java developers often encounter, provide examples of each mistake, explain why they are problematic, and offer solutions to correct them. I strongly recommend every Java developer whether he is beginner, intermediate or senior developer to go through the list once so that you are aware of these mistakes. If you have been coding in Java then most likely you would have also made the same mistake, if you do, let us know in comments so that we all can learn from each other. 

What is Constructor in Java and How it works? [with Example]

In simple word, Constructor is a method like a block of code which is called by Java runtime during object creation using new() operator. Constructor are special in the sense that they have the same name as the Class they are part of. They are also special in a sense that they are called by JVM automatically when you create an object. Have you ever thought about Why do you need a constructor? What benefits it provide? One reason is to initialize your object with default or initial state since default values for primitives may not be what you are looking for. One more reason you create constructor is to inform the world about dependencies, a class needs to do its job. Anyone by looking at your constructors should be able to figure out, what he needs in order to use this class.  For example, following class OrderProcessor needs a Queue and Database to function properly.

When to throw and catch Exception in Java? [Best Practice]

Exceptions are one of the confusing and misunderstood topics in Java, but at the same time, too big to ignore. In fact, good knowledge of Errors and Exception handling practices is one criterion, which differentiates a good Java developer from an average one. So what is confusing about Exception in Java? Well, many things like When to throw Exception or When to catch Exception, When to use checked exception or unchecked exception, should we catch errors like java.lang.OutOfMemoryError? Shall I use an error code instead of an Exception and a lot more? Well, I cannot answer all these questions in one post, so I will pick the first one when to catch or throw any Exception in Java.

7 Reasons of NOT using SELECT * in a Production SQL Query? Best Practices

Hello guys, if you are doing a code review and see a SELECT * in production code, would you allow it? Well, its not a simple question as it looks like but let's find out pros and cons about using SELECT * in a production SQL query and then decide. I have read many articles on the internet where people suggest that using SELECT * in SQL queries is a bad practice and you should always avoid that, but they never care to explain why? Some of them will say you should always use an explicit list of columns in your SQL query, which is a good suggestion and one of the SQL best practices I teach to junior programmers, but many of them don't explain the reason behind it. 

Difference between List and ArrayList Reference Variables in Java? Example Tutorial

Someone who is just starting with Java programming language often has doubts about how we are storing an ArrayList object in List variable, what is the difference between List and ArrayList? Or why not just save the ArrayList object in the ArrayList variable just like we do for String, int, and other data types. Well, the main difference between List and ArrayList is that List is an interface while ArrayList is a class. Most importantly, it implements the List interface, which also means that ArrayList is a subtype of the List interface. In Java or any object-oriented language, the supertype of a variable can store an object of subtype.

Top 5 Java EE Mistakes Java Web Developers should Avoid - Example

Hello guys, if you are working in Java EE and creating web applications and enterprise applications then you know that it's not as easy as it looks. You need to know some internal quirks so that your application can work properly in Production. Earlier, I have shared the free courses to learn full-stack Java development, and today, I am going to talk about some coding practices that you should avoid while creating Java web applications or Java EE applications. This will save you a lot of headaches when your application will go live and run in production.