Tuesday, August 27, 2024

How to escape HTML Special characters in JSP and Java? Example

Escaping HTML special characters in JSP or Java is a common task for Java programmers. There are many ways to escape HTML metacharacters in Java, some of which we have already seen in the last article escaping XML metacharacters in Java.  For those who are not familiar with HTML special characters, there are five e.g. <, >, &, ' and '' and if you want to print them literally just like here, Than you need to escape those characters so < becomes &lt;, > becomes &gt; and so on. 

How to lock a File before writing in Java? Example

A file is one of the oldest ways to store data and share data but if you are working in a shared file i.e a file that can be read or write by multiple readers and writers, you need to make sure that the file is locked before you try to write on it. This is needed to ensure that someone doesn't overwrite the data you are writing. Fortunately, Java provides a mechanism to lock a file before writing using the FileLock interface. You can get the handle of FileLock by using FileChannel for writing to a file. The FileChannel class is generally used to write faster in a large file and one of the common ways to write binary data in Java.

Monday, August 26, 2024

Difference between Static and Dynamic binding in Java

Hello guys, if you are wondering what is difference between static and dynamic binding and how it affect your program execution in Java then you are at right place. When you call a method in Java, it is resolved either at compile time or at runtime, depending upon whether it's a virtual method or a static method. When a method call is resolved at compile time, it is known as static binding, while if method invocation is resolved at runtime, it is known as Dynamic binding or Late binding. Since Java is an object-oriented programming language and by virtue of that it supports Polymorphism. Because of polymorphism, a reference variable of type Parent can hold an object of type Child, which extends Parent.

Is Cracking the Coding Interview book still worth it in 2024? Review

Hello guys, if you are preparing for Programming Job interviews and wondering whether the classic Cracking the Coding Interview book by Gayle Laakmann McDowell is still worth it in 2024 then you have come to the right place.  In the past, I have shared best books and courses for coding interviews where I mentioned this book and today, I am going to review this book in depth. This was one of the first book I used to prepare for coding interview and due to its focus on evergreen topic, I am happy to say that it's still relevant, but whether it's good enough now is another question, which we will find in this article.

Friday, August 23, 2024

Java ArrayList Tutorials and Examples for Beginners (with Java ArrayList Cheat Sheet)

Hello guys, if you want to learn ArrayList in-depth and looking for a complete guide on ArrayList then you have come to the right place. Earlier, I have shared the best Java collection courses and in this article, I am going to share tutorials and examples to learn and master ArrayList in Java. In the last 10 years, I have written several ArrayList tutorials, touching different ArrayList concepts and many how-to-do examples with ArrayList. In this tutorial, I am giving a summary of each of them. Why? So that any Java beginner who wants to learn ArrayList in detail, can go through the relevant tutorial and learn.

How to calculate sum and difference of two complex numbers in Java? Example

From the last couple of articles, I am writing about coding exercises for beginners e.g. yesterday you learned how to write a program from matrix multiplication in Java (see here) and a couple of days back, you have learned the recursive binary search algorithm. To continue that tradition today I am going to show you how to write a program for calculating the sum and difference of two complex numbers in Java. If you remember the complex number from you Maths classes, it has two-part real and imaginary and to add a complex number we add their real and imaginary part separately, similar to subtract complex number we minus their real and imaginary part separately. 

Wednesday, August 21, 2024

Is System Design Interview Book Vol 1 and 2 by Alex Xu worth it in 2024? Review

 Hello guys, if you are preparing for System design interviews or Software Design Interviews, then you must have come across System Design Interview - An Insider's Guide by Alex Xu, one of the most popular book on System Design after Designing Data-Intensive Applications by Martin Kleppmann. I first come across Alex Xu on Twitter when one of his image about how HTTPS works went viral. The image was quite detailed and presentable so I start following Alex and then I come across ByteByteGo, his online System design course and his book System Design Interview - An Insider's Guide

Tuesday, August 20, 2024

7 Projects You Can Do to Become a Frontend Master

Learning to code can be challenging, especially if you don't know where to begin. The greatest approach to improve your programming abilities is to use them to create coding projects.

Here are some programming projects to boost your confidence and make you a better developer.




Calculator app Abacus
The program that we all use on a daily basis is the calculator. The calculator is a project that is both simple and practical. Creating a calculator app can help you learn, how to build reusable components, how to use props, and how to handle states.


Blog Website Writing hand
Building your own blog doesn't only improve your coding skill, but your online presence too. If you have a blog and share content regularly, you can get a lot of visitors which can increase your online presence.


Weather App
Having a fully-featured weather app in your portfolio can help you a lot to get clients. And if you deploy this app, not only you but many people may get benefit from it


Spotify 2.0 Multiple musical notes
You can create Spotify 2.0, your own Spotify version. You can add as many features as you can and after completing, you can deploy it online :)

Movies App Film projector
You can create a movies app from scratch where you need to show movie details, posters, trailers, and cast. I believe that you will enjoy building this project.


YouTube UI Clone DVD
If you want to learn about grids, flexbox, and handling states then it would be better if you clone the YouTube UI. You don't need to 100% do the same as YouTube, you have the freedom to redesign and create your own version of YouTube.


Chat App Speech balloon
If you want to learn about Firebase, Firestore, Real-time database and etc. This project is for you, having this project in your portfolio can make your portfolio strong.