Array vs ArrayList in Java: Differences and When to Use Each
Array vs ArrayList in Java compared on size, capacity growth, boxing, type safety and Big-O cost, with a decision table and one-line conversions.
Array vs ArrayList in Java compared on size, capacity growth, boxing, type safety and Big-O cost, with a decision table and one-line conversions.
Learn to sort ArrayList in Java in ascending and descending order with List.sort(), Comparator.reverseOrder(), Collections.sort() and streams.
To convert decimal to hexadecimal, divide by 16 repeatedly and read the remainders in reverse, so 269 becomes 10D. See a worked division table, a table of common conversion examples, and the Java one-liners for both directions.
Learn about Spring @PathVariable and @RequestParam annotations and compare them with Jakarta’s @PathParam and @QueryParam annotations.
Starting Spring Framework 6.1 and Sring Boot 3.2, we can use the Spring RestClient for performing HTTP requests using a fluent and synchronous API. The RestClient works over the underlying HTTP client libraries such the JDK HttpClient, Apache HttpComponents, and others. As the name suggests, RestClient offers the fluent API design …
Learn to create Jasper reports in a Spring boot application, step by step, by configuring JasperReport library, loading the report templates, fill the data into reports and finally export the filled reports into a variety of formats.
Java record patterns with examples for instanceof, nested patterns, var, generics, sealed switch without default, null handling and MatchException.
Learn compact source files and instance main methods in Java 25 (JEP 512), formerly unnamed classes, with the IO class, implicit imports and rules.
Learn Java sequenced collections with examples of getFirst(), getLast(), reversed(), putFirst() and the exceptions and upgrade pitfalls to watch for.
Java 21 features with runnable examples for virtual threads, sequenced collections, record patterns and switch, plus each preview’s status in Java 25.
13 Java coding interview exercises with clear assumptions, working examples, edge cases and explanations for strings, arrays, stacks and search problems.
Learn to get started with Python Pandas library and using Pandas for data visualization, manipulation including advantages and limitations.
Learn to create a Kafka Streams application using Spring Boot. Also, learn about Topology and Processor and unit test the topology design.
Learn to use Spring CrudRepository and ListCrudRepository interfaces, their differences and the changes made in Spring Data 3.0 with examples.
Learn to write a REST API in Spring Boot that can handle single file and multiple file uploads. Also learn to validate the file sizes and types.
Learn to configure the Java compiler version in a Maven project and a Spring boot application using Maven as a build tool.
Learn to configure the logging levels for different packages and classes in a Spring boot application using properties, YAML and XML configurations.
Spring Security framework supports a wide range of authentication models, and in this tutorial, we will cover OAuth2 authentication using Amazon Cognito. We will walk through a step-by-step guide from creating the user pool in the AWS, adding the app client, and configuring it in the Spring Boot application. 1. …
Learn to build REST APIs in a Spring boot application with request validation, error handling, testing and API documentation with examples.
Learn to configure Spring boot application and Apache Kafka Producer, and Consumer, handle Kafka errors and retry in case of failures.
Learn the core concepts of configuring role-based authorization in Spring Security 6 and implementing authorization in a Spring Boot application.
Optional parameters may be left out and are undefined inside the function; default parameters fill in a value instead. Examples cover undefined vs null, order rules and options objects.
How slice(start, end) copies part of a TypeScript array: excluded end index, negative indexes, pagination and chunks, shallow copies, slice() vs splice(), and result types.
Learn to design and implement a Spring Boot REST API that accepts long-running tasks and publishes the execution progress to a Kafka topic.
Spring @KafkaListener and @KafkaHandler annotations provide convenient ways to consume and handle messages from Kafka topics.
Learn to configure KafkaAdmin with custom properties, and create new topics in the Kafka cluster using AdminClient.createTopics() with example.
Learn the basics of KafkaTemplate, configure KafkaTemplate with custom properties, and configure producer and consumer factories with examples.
Fix This version of ChromeDriver only supports Chrome version with Selenium Manager, a clean PATH, a pinned Chrome for Testing build or WebDriverManager.
Learn about top 5 template engines for Spring MV applications, comparing their features and setup process, to make more informed decisions.
Learn to fix Maven invalid target release error which indicates that Java versions used in Maven and in the application are not compatible.
Learn to call OpenAI ChatGPT APIs in Spring Boot RestTemplate or WebClient with an example. Also, log the requests and responses for debugging.
Run a single-node Kafka and a 3-node Kafka cluster with Docker Compose in KRaft mode on Kafka 4.3, then test replication, leader election and failover with real output.
Learn the most common solutions for the Spring boot application closing automatically after start, with exit code 0 and no exceptions logs.
Since Spring Boot 3.1, @ServiceConnection is used to provide connection details to a remote service that takes precedence over details in the properties file.
Learn to use Redis Streams in a Spring Boot application to implement simple, in-memory and real-time stream processing of messages/events.
Learn to use Spring boot docker compose module, customize the compose file and container lifecycle with an example.
Learn the fundamentals of working with S3 buckets and objects using Spring Cloud AWS library and its S3Client and S3Template classes.
Learn how Java Map computeIfAbsent() works, with multimap and cache examples, null and exception rules, thread safety and the putIfAbsent() difference.
If you’re preparing for a job interview, these Spring security interview questions will help you understand key concepts and increase the confidence.
Connect Spring Boot 4 to Redis with Lettuce or Jedis. Compare the two clients, set the spring.data.redis properties and the commons-pool2 pool, use RedisTemplate, StringRedisTemplate and a @RedisHash repository, and test with Testcontainers.
Learn to use Redis Pub/Sub with Spring Boot Data, and configure the message publishers and subscribers (listners) for a given channel topic.
Learn to use the search API provided by Keycloak to search for users by ID, email, username, custom attributes, and role.
Learn to use integrate DynamoDB using Spring-cloud-aws module and its DynamoDbTemplate and DynamoDbEnhancedClient beans with examples.
WebSecurityConfigurerAdapter was deprecated in Spring Security 5.7 and removed in 6.0. Replace it with a SecurityFilterChain bean, requestMatchers, a PasswordEncoder bean, WebSecurityCustomizer and @EnableMethodSecurity on Spring Boot 4, with tests.
Add Spring Security to a Spring Boot 4 application, see what it secures by default, and write your own SecurityFilterChain with tested examples. Every Spring Security guide on the site, grouped by topic.
36 Java concurrency interview questions with concise answers and examples covering thread states, synchronization, visibility, race conditions, executors and concurrent collections.
Step by step, we will learn to deploy a Spring Boot application to AWS Elastic Beanstalk which uses RDS for persisting the records in the database.
Let us explore some of the most frequently asked Docker interview questions for devops and provide insights on how to approach them.
Java string templates were withdrawn in JDK 23 and do not exist in Java 25. See the old syntax, why it was dropped and the replacements that work today.
By combining the portability and flexibility of Docker containers with AWS’s reliable and scalable infrastructure, we can take our Spring Boot applications to new heights. In this comprehensive guide, we’ll show exactly how to deploy a Dockerized Spring Boot app to AWS ECS from start to finish. 1. Introduction to …
HowToDoInJava provides tutorials and how-to guides on Java and related technologies.
It also shares the best practices, algorithms & solutions and frequently asked interview questions.