Monday, January 31, 2022

How Garbage Collection works in Java? Explained

I have read many articles on Garbage Collection in Java, some of them are too complex to understand and some of them don’t contain enough information required to understand garbage collection in Java. Then I decided to write my own experience as an article. You can call it a tutorial about garbage collection in simple words, which would be easy to understand and have sufficient information to understand how garbage collection works in Java. Garbage collection works by employing several GC algorithms like Mark and Sweep, G1, etc. There are different kinds of garbage collectors available in Java to collect different areas of heap memory like you have serial, parallel, and concurrent garbage collectors in Java.

Sunday, January 30, 2022

Why String is Immutable or Final in Java? Explained

The string is Immutable in Java because String objects are cached in the String pool. Since cached String literals are shared between multiple clients there is always a risk, where one client's action would affect all other clients. For example, if one client changes the value of the String "Test" to "TEST", all other clients will also see that value as explained in the first example. Since caching of String objects was important for performance reasons this risk was avoided by making the String class Immutable. At the same time, String was made final so that no one can compromise invariant of String class like Immutability, Caching, hashcode calculation, etc by extending and overriding behaviors. Another reason why the String class is immutable could die due to HashMap.

Sunday, January 16, 2022

Top 30 JavaScript Interview Questions with Answers for 1 to 5 Years Experienced Programmers

Building a career as a developer in the IT industry can be challenging if you lack stream-specific preparation. For instance, if you want to be a JavaScript developer, you have to dig deep into its concepts and learn every bit about JavaScript, but then also, I would say, you are 50% prepared for the Job. I'm not saying that you aren't capable enough to get that JavaScript developer's Job; instead, I mean to say that you aren't ready enough to face the recruiters.

Saturday, January 1, 2022

Top 10 Most Popular Programming Languages of the Last 50 Years and their Inventors

There are many programming languages out there in the software world, and they are still coming like Scala, Go, TypeScript, Rust, etc., but only a handful of them have managed to survive to date. These are the ones who have contributed immensely to software development. Since programming language is the single most important thing in the software development world, it's often discussed, criticized, and improved over the years. Programmers and developers, who those programming languages are icons of the programming world and sometimes I feel sad when a guy using a programming language doesn't know, who is behind that.