Quantcast
Channel: Java Archives - Java Code Geeks
Browsing all 743 articles
Browse latest View live

Getting Started with Jakarta Faces

Jakarta Faces, formerly known as JavaServer Faces (JSF), is a powerful framework for building user interfaces for Java web applications. It simplifies the development process by providing a...

View Article


Java Streams: 5 Powerful Techniques You Might Not Know

Java Streams have revolutionized how developers process collections in Java 8 and beyond. They offer a concise, functional approach that improves code readability and maintainability. While you might...

View Article


Memory-Friendly File Reading in Java

Java offers powerful tools for working with files. But when dealing with massive files, traditional methods can quickly run into memory limitations. This can lead to program crashes and hinder...

View Article

JVM Tuning vs. Java Optimization: Boosting Java Performance

In improving Java performance, two crucial strategies stand out: JVM tuning and Java optimization. While both aim to improve the efficiency and speed of Java applications, they operate at different...

View Article

Java Patterns, Singleton: Cons & Pros

Singleton, a creational design pattern introduced by the Gang of Four in 1994, faces criticism for its frequent misuse due to its straightforward implementation. Consequently, it has evolved into an...

View Article


Building Clean API Responses with Spring Boot

In the realm of Spring Boot applications, well-designed APIs are the lifeblood of communication. They serve as the bridges between your application and the outside world, exchanging data and...

View Article

Find the Square Root of BigInteger In Java

In Java, BigInteger is a class that enables the representation of arbitrarily large integers. It offers operations for arithmetic, comparison, and bit manipulation on integers beyond the range of...

View Article

Partitioning a Stream in Java

Java Streams is a powerful abstraction for processing collections. Often, we need to divide a stream into smaller chunks for further manipulation. This article explores various techniques to partition...

View Article


Spring Boot CommandLineRunner Example

Spring Command Runner is an interface in the Spring Framework that allows developers to execute code upon the startup of a Spring application. Let us delve into a practical example of Spring Boot...

View Article


Test Repository with @DataJpaTest and JUnit

1. Introduction In today’s software development landscape, ensuring the reliability and correctness of applications is paramount. Testing plays a crucial role in achieving these goals, particularly in...

View Article

Spring Data REST: Build RESTful APIs in Minutes

In the fast-paced world of web development, efficiency is king. Building robust and secure RESTful APIs can often feel like a time-consuming endeavor, requiring meticulous controller and service...

View Article

SpringRunner vs. SpringBootTest

Testing is essential for all applications, encompassing both unit and integration tests. The cornerstone for conducting integration tests lies in classes like SpringRunner and SpringBootTest. Let’s...

View Article

Remove Only Trailing Whitespace From a String in Java

In programming, handling whitespace characters within strings often requires careful manipulation, especially when dealing with leading or trailing spaces. Trailing spaces refer to whitespace...

View Article


@Transactional in Spring: Don’t Get Caught in These Traps

Transactions are a fundamental concept in database management, ensuring data consistency across multiple database operations. Spring provides the @Transactional annotation to simplify transaction...

View Article

Retrieving First n Characters in a String in Java

When working with strings in Java, there are different ways to extract the first n characters efficiently. This article will explore achieving this using standard JDK methods and then showcase...

View Article


Spy vs SpyBean In Spring

Distinguishing between @Spy and @SpyBean involves understanding their functions and knowing when to use each. By gaining a comprehensive understanding of these tools, developers can optimize their...

View Article

The Future of Async in Java: CompletableFuture vs Virtual Threads

Asynchronous programming is a cornerstone of modern Java applications, allowing them to handle tasks without blocking the main thread. But with Java 21 comes a new challenger: virtual threads. These...

View Article


Using Spring Data JPA Repository for Database Views

When developing applications, it is common to work with database views alongside traditional tables to simplify complex data operations. Spring Data JPA in the Spring ecosystem, can seamlessly...

View Article

Spring Boot ServiceConnection Example

Spring Boot, a popular Java framework, simplifies the process of building robust and scalable applications. In many applications, connecting to external services, such as databases, APIs, or messaging...

View Article

Spring Bean Naming

In the Spring framework, each bean must possess a name that is unique within its containing ApplicationContext. Spring employs straightforward and default naming conventions to assign names to beans,...

View Article
Browsing all 743 articles
Browse latest View live