Tag: Quarkus

What’s the difference between Concurrency and Parallelism?
Natan Ferreira
- 0
- 44
Concurrency and Parallelism are important concepts for bringing more efficiency to software, but they do not mean the same thing. A software application can handle multiple tasks, and the way these tasks are processed differs in each concept. Concurrency Imagine the scenario where we have a software that needs to process multiple tasks, such as…
Read More
How to avoid NullPointerException in Java using Optional?
Natan Ferreira
- 0
- 134
Optional was introduced in Java 8 as a way to handle potentially null values more safely and expressively. It helps to avoid NullPointerException and makes the code more readable. Hands on Creating an Optional Optional can be created in several ways: Printing the results will show the following output. Checking for Value Presence Optional provides…
Read More
How do @PostConstruct and @PreDestroy annotation work in java?
Natan Ferreira
- 0
- 163
Methods annotated with @PostConstruct and @PreDestroy are commonly used in the lifecycle of beans managed by the container, such as in frameworks like Spring or Quarkus. An example of their use is opening and closing database connections. If you want to know more about Bean management in Spring, don’t hesitate to read this post. @PostConstruct…
Read More
How do functional interfaces work in Java?
Natan Ferreira
- 0
- 205
Functional Interfaces are a fundamental concept in functional programming introduced in Java 8. They are interfaces that have exactly one abstract method, allowing the use of lambda expressions and method references to make the code more concise and readable. They can be used in Streams, for example, and promote code reuse. We can find several…
Read More
What is Shallow Copy and Deep Copy in Java?
Natan Ferreira
- 0
- 187
When developing software, there may be situations where it is necessary to create copies of objects to prevent unwanted behaviors, whether to avoid different parts of the system modifying the same object or for any other reason that prevents undesired behavior. Java provides the Cloneable interface, which allows object copying. There are two types of…
Read More
How does serialization and deserialization work in Java?
Natan Ferreira
- 0
- 219
Serialization and deserialization are essential for persisting or transferring data between systems. Serialization transforms Java objects into formats like JSON or XML, enabling storage or network transmission. Deserialization, on the other hand, restores these objects, making the data reusable in applications. These processes are widely used in APIs, data persistence, and communication between distributed systems,…
Read More
How to use Generic Types in Java?
Natan Ferreira
- 0
- 121
The use of Generics in Java improves security, readability, and code reuse, simplifying the development of robust and secure applications. Let’s see some usage examples below. Generic Methods <T>: It’s a generic type parameter, accepting any type. T Item: The method accepts a parameter of the generic type. We can specify, for example, String and…
Read More
How to sort Java Collections?
Natan Ferreira
- 0
- 139
Sorting in Java Collections is an essential feature for organizing collection elements in ascending or descending order. Using the Comparable or Comparator interfaces, custom sorting criteria can be defined. The Collections class provides utility methods, such as sort(), to apply these rules. This enables efficient and flexible data processing. Hands on The following example is…
Read More
How to run tasks in parallel with timeout in Java?
Natan Ferreira
- 0
- 258
The use of Threads is essential to improving the performance and responsiveness of modern applications. With threads, it is possible to execute multiple tasks simultaneously, maximizing processor resources. They allow intensive operations, such as calculations or accessing external resources (e.g., databases, APIs), to be performed in parallel without blocking the main execution. Imagine the following…
Read More
What is Richardson Maturity Model?
Natan Ferreira
- 0
- 177
It is a model (developed by Leonard Richardson) to improve API maturity. To achieve the glory of REST, the API must have maturity levels. There are 4 levels, and next we will see how each of them works. Level 0: The Swamp of POX This level defines that the use of the HTTP protocol is…
Read More