Tag: Java

5 Multithreading Options in Java

Computing power and performance have skyrocketed since their invention. The number of cores and their potentials are like nothing before, giving your application infinite possibilities. Despite the vast improvement, a single-threaded application can only utilize a maximum of one core and cannot bene...

17 Pro JavaScript tricks you didn’t know

JavaScript : Tricks You Should Know The ternary operator let hungry = true; let eat; if (hungry === true) { eat = 'yes'; } else { eat = 'no'; }   Read More

What exactly did Kotlin learn from Java?

JetBrains, the genius folks who gave us IntelliJ IDEA, pulls back the curtain on Kotlin — a fresh-faced, eager programming language ready to take on the world. Fast-forward a decade, and this rookie has carved out a niche in the coding big leagues, securing a spot in the TIOBE Index&rs...

My ten-year quest for concise lambda expressions in Java

I started learning Java in 1997. I thought initially Java would be a fad and that Smalltalk would emerge as the victor in the battle for object-oriented programmer productivity over C++. I was wrong. In the great object-oriented battles in the 1990s between C++ and Smalltalk, Java emerged as the vic...

Java 21 So How Should We Construct Strings Now?

Java 21 brings in a lot of cool features, and one of them is the String Templates. While it serves more purposes than just classic String interpolation, for us Java developers, it’s yet another way to concatenate Strings in a “proper” way. What is proper, though? I pok...

Must-have tools for Java developers

In this overview, I want to show you some of the tools I use daily and find very useful. Some of them are strictly related to development in Java some are more general, so even if you don’t use Java, there is a hope that you will find something interesting here! Integrated Development Envir...

How to Leverage the @RolesAllowed Annotation for Optimal Security in Java Spring

Security is a paramount concern for any application. Ensuring that your system’s resources are accessed only by the right people is essential. In the Java Spring framework, several annotations enable developers to handle security. One of them is the @RolesAllowed annotation, which pr...

Java Best Practices for Writing Clean and Professional Code

Secrets of Clean Code: A Journey through Java Best Practices for Ongoing Coding Mastery   Writing professional and clean Java code is essential for any Java developer who wants to unleash the full potential of their software. I’ll be discussing seemingly small details, yet they h...

Everything Bad in Java is Good for You

“Everything Bad is Good for You” is a pop culture book that points out that some things we assume are bad (like TV) have tremendous benefits to our well-being. I love the premise of disrupting the conventional narrative and was reminded of that constantly when debating some of ...

What exactly did Kotlin learn from Java?

JetBrains, the genius folks who gave us IntelliJ IDEA, pulls back the curtain on Kotlin — a fresh-faced, eager programming language ready to take on the world. Fast-forward a decade, and this rookie has carved out a niche in the coding big leagues, securing a spot in the TIOBE Index&rs...

Java: Best Practices for Writing Clean and Professional Code

Writing professional and clean Java code is essential for any Java developer who wants to unleash the full potential of their software. I’ll be discussing seemingly small details, yet they hold tremendous importance and have the potential to transform you into a highly efficient engineer. ...

Sweating the small stuff in Java

Sometimes, You’re on Your Own Every once in a while, we are required as application developers to roll up our sleeves and find ways to squeeze performance or memory savings beyond the built-in capabilities of our language and libraries. I started programming professionally in DOS/Clipper...

Stop using nested ifs. Do this instead

A typical use case for nested ifs: you want to perform all sorts of checks on some data to make sure it’s valid before finally doing something useful with it. Don’t do this! : // JavaScript function sendMoney(account, amount) { if (account.balance > amount) { if (am...

Choosing the Right Tech for Android Development: Java, Kotlin, Flutter, and React Native

In the swiftly evolving realm of mobile app creation, the choices you make regarding technology wield substantial influence over your project’s triumph and efficiency. Within the domain of Android app development, a handful of alternatives rise to prominence: Java, Kotlin, Flutter, and Re...

A Beginner’s Guide to Retrofit in Android (Java)

In the world of Android app development, making network requests to fetch data from APIs is a common task. Retrofit is a powerful and popular library that simplifies this process by providing a clean and efficient way to make API calls. In this tutorial, we’ll walk through how to use Retrofit ...

SimpleExoPlayer android java play video online

Add gradle.properties android.useAndroidX=true android.nonTransitiveRClass=true android.enableJetifier=true 2. Add in app build.gradle dependencies implementation 'com.google.android.exoplayer:exoplayer:r2.4.0' implementation 'com.google.android.exoplayer:exoplayer-c...

Java To Kotlin : Manual Steps to convert the code

In the 2017 Google I/O conference, Kotlin was announced as an official language for Android app development. it is a powerful and versatile language that is well-suited for a variety of development tasks. Also, Kotlin is interoperable with Java, making it easy to convert existing Java code...

Top 10 Kotlin Interview Questions/Problems

Kotlin is an influential programming language that combines both the functional and object-oriented programming paradigms. It is notably known for its succinct syntax and its seamless interoperability with Java. This has made Kotlin a popular choice for Android development. If you’re preparing...

The Evolution of Java

Java was first released, and over the years, it has undergone significant changes. I started working with Java in the early 2000s, using J2SE 1.3, which lacked features that are now commonplace. Java 5 introduced generics, “for each” loops, annotations, autoboxing, and unboxing, resultin...

Optional in Java

Java introduced the `Optional` class in Java 8 to better handle null references. Optional is a container object that may or may not hold a value. The class then provides methods to operator on the data that it may contain. An Optional can be created for any data type in Java. For primitive data t...

What exactly did Kotlin learn from Java?

JetBrains, the genius folks who gave us IntelliJ IDEA, pulls back the curtain on Kotlin — a fresh-faced, eager programming language ready to take on the world. Fast-forward a decade, and this rookie has carved out a niche in the coding big leagues, securing a spot in the TIOBE Index&rs...

Java 21: So How Should We Construct Strings Now?

Java 21 brings in a lot of cool features, and one of them is the String Templates. While it serves more purposes than just classic String interpolation, for us Java developers, it’s yet another way to concatenate Strings in a “proper” way. What is proper, though? I pok...

Overloading typescript constructor like cpp or Java with a catch

When ever I was looking into the typescript Date class constructor implementation, I always wondered how its constructor signature worked like that, how it can have many signature, how can it work with 1st argument as number or string or an instance of itself. Every time I tried to implement the con...

Why Swift Is Better Than Java For Apple Developer?

Swift stands as a contemporary and robust programming language that Apple designed for crafting applications across its suite of devices. What sets Swift apart is its blend of performance and security, all wrapped in a clear and expressive syntax. Notably, it prioritizes safety through mechanisms li...

Beginner Journey Learning Rust

Last week, I decided to code using Rust . I’ve followed Rust since its initial version, reading many sources, and cases, and exploring its ecosystem such as any available libraries, and I have to admit, that the progress is really fast and rich. For context, I’m a programmer...

Stop Using DTOs in Go, It’s Not Java

DTOs are Java classes that contain data and have no behavior. They’re used to transfer data between layers of an application, such as between a controller and a service layer. DTOs are often used to encapsulate data and provide a layer of abstraction between the layers of an application....

Why use functional programming, lambda, and generics, in Java

The Java programming language is famous for being Object Oriented, and infamous for being verbose and full of checked exceptions. When the Java language designers introduced Functional Programming abilities into the language with version 1.8, it wasn’t immediately understood how that would hel...

Basic Memory-Saving Techniques for Java Programming

Java is a popular programming language that is widely used for developing complex applications. However, one of the common issues with Java programs is high memory usage, which can lead to performance issues and even crashes. Therefore, it is important to use memory-saving techniques to optimiz...

JAVA 21 is here, but….

I was amazed with the amount of posts about Java 21, its new ( and severals) features, its previews, etc. some of them are very interesting and necessary, but others I saw as an unnecessary way of be more closer to other languages that have taken away a bit of the market share, for example Unnamed C...

DevOps (Lab-1)-Installing Apache Maven and deploying a Java application

Hi everyone. Alongside the current bootcamp I am assisting, I decided to follow along some other projects with the intention of gaining hands on experience on DevOps related tools and applications. The DevOps series I will be following can be found here: YouTube About Maven: Maven is c...

Using JLink to create smaller Docker images for your Spring Boot Java application

Containers bring new flexibility and agility to software development and deployment. However, they also introduce a new attack surface that malicious actors can exploit. A compromised container can give an attacker access to other containers and even the host system. Smaller images that contain fewe...

TERRAFORM for Java Developers

So your pretty good at Spring Boot Java development, have a good idea of how AWS EC2 instances work and now want to try a bit of automation to make things go smoother. I’ve always wanted to get away from the AWS Console to create an EC2 instance, in my perfect view I will just run a script ...

What exactly did Kotlin learn from Java?

JetBrains, the genius folks who gave us IntelliJ IDEA, pulls back the curtain on Kotlin — a fresh-faced, eager programming language ready to take on the world. Fast-forward a decade, and this rookie has carved out a niche in the coding big leagues, securing a spot in the TIOBE Index&rs...

DevOps (Lab-2)-Deploying a Java application using Maven and Tomcat

Hi everyone, I am back with another hand on DevOps lab. In this lab we will learn how to install Tomcat and deploy a Java application. In the last lab we installed, built and deployed an application using Maven. We will be building from the last lab in where we wi...

Download Java rules from an already running SonarQube instance

To download Java rules from an already running SonarQube instance, you typically don’t need to download the rules separately. SonarQube stores and manages its rules within its database, and you access and configure them through the SonarQube web interface. Here are the steps to access and mana...

How to install Java 21 and setup JAVA_HOME Path in macOS (Apple Silicon M1 & M2)

wondering how to install Java and set up the JAVA_HOME path. Java is a versatile programming language that’s used in various applications, and having it properly installed on your macOS is essential for developers and tech enthusiasts. In this guide, we’ll walk you through the steps to g...

What is JDK in Java and How to Install it on Windows

Introduction to JDK in Java Java is a versatile and widely-used programming language known for its portability and compatibility across various platforms. Whether you’re a seasoned developer or just starting your coding journey, understanding the fundamentals of Java Development Kit (JDK) i...

Advanced Java Course

Java is a popular programming language used for developing enterprise applications, mobile applications, and web applications. With the increasing demand for Java professionals in the IT industry, it is essential to have a good understanding of advanced Java concepts. The Advanced Java course offere...