Java’s ArrayList is a dynamic array implementation of the List interface. Learn how and when an ArrayList should be used.
I guess you’re here because you want to learn how to use the ArrayList in your Java code. You’re in the right place!
As explained in the Java documentation, ArrayList is:
A resizable array: implementing the List interface, Mutable: objects can be added and/or removed, Not Thread-safe: ArrayList is not suitable for concurrent access. See Thread Safety for more information. Let’s explore how to use an ArrayList through simple code examples!
Java’s LinkedList is a doubly-linked List implementation. Lists are ordered sequences of objects. Learn how and when a LinkedList should be used.
The question which often arises is: are LinkedList preferable to ArrayList? In which case should I use it?
As explained in the Java documentation, LinkedList is:
A doubly-linked chain: elements are stored in nodes, with linking back and forth between themselves, Mutable: objects can be added and/or removed, Not Thread-safe: LinkedList is not suitable for concurrent access. See Thread Safety for more information. Let’s explore how to use a LinkedList through simple code examples!
Math pow is a function which calculates the power of any base number in Java. We’re going to learn how to avoid the common pitfalls around this method.
I’m sure you have already experienced odd results when calling Math.pow method. I know, I’ve been there too!
Math.pow(double a, double b) returns the value of a raised to the power of b.
It’s a static method on Math class, which means you don’t have to instantiate a Math instance to call it. The power of a number is the number of times the number is multiplied by itself.
Example Code Let’s see the following example:
Quick and easy way to secure a Rest API with Spring Security. Spring Boot 2 and Spring Security 5 tutorial with real-world code examples.
Most Spring Tutorials available online teach you how to secure a Rest API with Spring with examples which are far from real application problematics. You surely agree that most tutorials lack real-world use-cases.
This tutorial aims to help you secure a real-world application, not just another Hello World Example.
In this tutorial we’ll learn:
How to secure a Spring MVC Rest API using Spring Security, Configure Spring Security with Java code (no painful XML), And delegate authentication to a UserAuthenticationService with your own business logic.
Get started quickly with your first Rest API. Learn how to build it with Spring Boot, Spring MVC, Thymeleaf and Jackson Json.
I’m sure you’re looking for a complete Spring Rest Tutorial which covers the most important topics related to Spring Boot. You’re in the right place!
You want to build a web application or a REST API using Spring Boot (and other popular technologies like Thymeleaf), but you don’t know where to start… Let me help you get things done. This tutorial explains how to create a simple Rest Api exposing data as Json.
Spring Autowiring loop, also known as circular references, can give headaches. Get actionable insights on how to solve them through real code examples.
I know you’ve been there, like me:
I Have a circular dependency in Spring and my application fails to launch. How to solve this? The typical exception thrown by Spring is the following:
‘org.springframework.security.authenticationManager’: Requested bean is currently in creation: Is there an unresolvable circular reference?
And, It does not give much details. So, let’s see how we can break the circular dependency cycle and save some sanity!
Learn how to autowire beans, inject dependencies into other beans and explore various autowiring methods with Spring. And make your code more extensible.
Spring is a Java library which delivers a useful feature: Inversion Of Control. Basically, instead of instantiating your Java services with new, Spring does it for you.
You may be wondering:
That’s nice, but isn’t new already enough? How does the @Autowired annotation work? How does Spring instantiated and lookup the right beans and services for me? Good news! We’ve got you covered. I know how difficult Spring is to understand, I’ve been there.
Learn how to serialize and deserialize polymorphic object trees with Jackson Json Databind. Using practical code examples to make it easy to understand.
Jackson Json is a powerful Java library to serialize and deserialize objects to/from Json.
You may ask yourself:
How can I serialize and deserialize polymorphic class instances? How to configure Jackson to serialize objects being represented by their interface? Good news! The answer is just below.
It’s somehow difficult to find real examples showing how to do this. That’s why I’ve decided to make this little tutorial to help you get the idea quickly with practical code examples.
We’re committed to ship software with high quality standards. It’s in our company’s heart.
As mentioned in our previous article, Are You Buying Quality Software, we aim to deliver features at fast pace while maintaining the highest possible code quality. Our last article about our code quality has been written more than one year ago, how are we doing today? The following sections get you an insight about the code quality of our backend server written in Java.
So you’re saying you have no bugs?
This blog post lists the various steps we took to upgrade OctoPerf’s frontend to the latest AngularJS version.
When we started developing our load testing solution we had to choose a technology to create the UI. Most of us had previous experiences with GWT or Vaadin but we were not satisfied with it. It took us too much effort to create a sketch of the application and it didn’t even look good.