Learn why missing annotations won’t cause any exceptions at runtime
Also find me here:
Baeldung Author
Ali Dehghani
Has a BSc in Chemical Engineering and MSc in Information Technology. Except for the major change, nothing else has changed, still, a computer geek who is passionate about all aspects of software engineering looks for elegant and possibly new solutions, eager to learn and hopefully help fellow software geeks to do so.
Here's what I've written (so far):
Baeldung on Java
- All
- JVM (15)
- Java (5)
- Java Concurrency (3)
- Testing (1)
- Spring Persistence (1)
- Spring Boot (1)
- Spring (1)
- Java String (1)
- Java Array (1)
- DevOps (1)
- Artificial Intelligence (1)
- Algorithms (1)
Configuring the Server Port on Quarkus Applications
Filed under DevOps
Learn a couple of ways to configure the application port in Quarkus
Find the GC Algorithm Used by a JVM Instance
Filed under JVM
Learn different approaches to find the GC algorithm used by a particular JVM instance
Web Server Graceful Shutdown in Spring Boot
Filed under Spring Boot
Learn how to take advantage of the new graceful shutdown feature in Spring Boot 2.3
Performance Comparison of boolean[] vs BitSet
Filed under JVM
Compare BitSets and boolean[] in terms of performance in different scenarios
Difference in Used, Committed, and Max Heap Memory
Filed under JVM
Learn how adaptive sizing works and evaluate the difference between max, used, and committed sizes
A Guide to BitSet in Java
Filed under Java
Learn how we can use a Java BitSet to represent a vector of bits, gett familiar with the BitSet internals, and take a closer look at its API
A Guide to False Sharing and @Contended
Filed under Java Concurrency
Learn how sometimes false sharing might cause counterproductive effects on the performance of multithreaded applications
Garbage Collection and Cyclic References in Java
Filed under JVM
Learn how the JVM makes sure to collect the unreachable but cyclic object references
Memory Address of Objects in Java
Filed under JVM
Learn how to find the memory address of objects in Java
Measuring Object Sizes in the JVM
Filed under JVM
Learn how to measure Java object sizes with various tools such as JOL, Java Agents, and the jcmd command-line utility
Configuring Stack Sizes in the JVM
Filed under JVM
Learn how to configure the thread stack sizes in the HotSpot JVM
When Does Java Throw the ExceptionInInitializerError?
Filed under Java
Learn what causes Java to throw an ExceptionInInitializerError using a few practical examples
Where Is the Array Length Stored in JVM?
Filed under Java Array, JVM
If you always wanted to know how JVM stores array length, you will find the answer here.
Memory Layout of Objects in Java
Filed under JVM
Learn how the JVM lays out objects and arrays in the heap
Exploring JVM Tuning Flags
Filed under JVM
Learn a few ways to discover JVM tuning flags and learn how to work with them
boolean and boolean[] Memory Layout in the JVM
Filed under JVM
Learn the footprint of a boolean value in the JVM in different circumstances
<init> and <clinit> Methods in the JVM
Filed under JVM
See how the compiler and runtime use the init and clinit methods for initialization purposes
String Concatenation with Invoke Dynamic
Filed under Java String
Learn about relatively new Java optimization: string concatenation with invokedynamic
Super Type Tokens in Java Generics
Filed under Java
Learn how to preserve the generic type information at runtime using super type tokens.
An Introduction to Invoke Dynamic in the JVM
Filed under JVM
Learn about invokedynamic and see how it can help library and language designers to implement many forms of dynamicity.
Executors newCachedThreadPool() vs newFixedThreadPool()
Filed under Java Concurrency
Compare the newCachedThreadPool() and newFixedThreadPool() implementations and their use-cases
Guide to RejectedExecutionHandler
Filed under Java Concurrency
Learn about what happens when a thread pool can’t accept any more tasks and how to control this by applying saturation policies
A Guide to Spring’s Open Session in View
Filed under Spring
Learn about Spring’s Open Session In View pattern
Programmatic Transaction Management in Spring
Filed under Spring Persistence
Learn to manage transactions programmatically in Spring and why this approach is sometimes better than simply using the declarative Transactional annotation.
Counting Sort in Java
Filed under Algorithms, Java
Learn about the counting sort and then implement it in Java.
The K-Means Clustering Algorithm in Java
Filed under Artificial Intelligence
Learn about the K-Means clustering algorithm using a real-world dataset from Last.fm
Compressed OOPs in the JVM
Filed under JVM
Find out how to tune the JVM to use memory more efficiently and address 32Gb of heap even in a 32-bit system.
Native Memory Tracking in JVM
Filed under JVM
Learn about native memory allocation in the JVM and how to track it.
Guide to JUnit 5 Parameterized Tests
Filed under Testing
Learn how to simplify test coverage in JUnit 5 with parameterized tests
Baeldung on Linux
- All
- Processes (1)
How Long a Linux Process Has Been Running
Filed under Processes
Learn about the ps command-line utility to find out how long a particular process is running.
Baeldung on Kotlin
- All
- Kotlin Collections (9)
- Kotlin Strings (8)
- Kotlin Basics (7)
- Kotlin Classes and Objects (6)
- Kotlin-Java Interop (3)
- Kotlin Functions (3)
- Functional Programming (3)
- Kotlin IO (2)
- Kotlin Concurrency (1)
- Kotlin (1)
Why Kotlin lateinit Can’t Be Used With Primitive Types
Filed under Kotlin Basics
Learn why we can’t use late-initialized properties and variables for primitive types in Kotlin
The Difference Between init Block and Constructor in Kotlin
Filed under Kotlin Classes and Objects
Learn the difference between init blocks and constructors in Kotlin along with a peek at the generated bytecode for each case
Returning Multiple Values From Kotlin Functions
Filed under Kotlin Functions
Learn how to use built-in types such Pair and Triple, collection types and arrays, and finally, data classes, to return multiple values.
Writing InputStream to File in Kotlin
Filed under Kotlin IO
Learn a few approaches to copy the contents of an InputStream to a file in Kotlin.
A Guide to @Throws in Kotlin
Filed under Kotlin-Java Interop
Learn how the @Throws annotation facilitates calling Kotlin methods and functions from Java
Removing Duplicate Elements From Collections in Kotlin
Filed under Kotlin Collections
Learn two approaches to remove duplicate elements from a collection or array
Copying a List in Kotlin
Filed under Kotlin Collections
Learn a couple of ways to copy the contents of a List to another one in Kotlin
Removing All Non-Alphanumeric Characters in Kotlin
Filed under Kotlin Strings
Learn a few ways to remove all non-alphanumeric characters from a string in Kotlin
Copy a Map in Kotlin
Filed under Kotlin Collections
Learn a couple of ways to copy the contents of a Map to another one in Kotlin
Difference Between crossinline and noinline in Kotlin
Filed under Functional Programming
Learn about two consequences of lambda function inlining in Kotlin: noinline and crossinline
Functions for Replacing Part of a String in Kotlin
Filed under Kotlin Strings
Learn a handful of ways to replace part of a string with something else in Kotlin
“Val cannot be reassigned” Issue on Function Parameters in Kotlin
Filed under Functional Programming
Learn that function parameters are immutable in Kotlin
Creating a New Instance from a KClass in Kotlin
Filed under Kotlin Classes and Objects
Learn a few ways to instantiate Kotlin objects with the help of reflection and KClass tokens
The Difference Between map() and flatMap() in Kotlin
Filed under Functional Programming, Kotlin Collections
Learn the subtle differences between map() and flatMap() in Kotlin
Creating Collections with Repeating Elements in Kotlin
Filed under Kotlin Collections
Learn how to create different collections such as Lists, MutableLists, or even Arrays with repeating elements in them
The getClass() Equivalent in Kotlin
Filed under Kotlin Classes and Objects, Kotlin-Java Interop
Learn how to retrieve the KClass token in Kotlin
The @JvmStatic Annotation in Kotlin
Filed under Kotlin IO, Kotlin-Java Interop
Learn how the @JvmStatic annotation affects the generated JVM bytecode
Get All Subclasses of a Sealed Class in Kotlin
Filed under Kotlin Classes and Objects
Learn how to find all subclasses of a particular sealed class in Kotlin
Splitting a String in Kotlin
Filed under Kotlin Strings
Learn a couple of ways to split Strings into a sequence of elements in Kotlin
IntArray vs Array<Int> in Kotlin
Filed under Kotlin Collections
Learn how primitive arrays and their corresponding parameterized Array types are different in terms of JVM representation and API
Read Environment Variables in Kotlin
Filed under Kotlin Basics
Learn how we can have access to the system environment variables in Kotlin
Convert Int to Hex String in Kotlin
Filed under Kotlin Strings
Learn a few ways to convert integers to their corresponding hexadecimal values
Difference Between List and Array in Kotlin
Filed under Kotlin Collections
Compare Array and List types in Kotlin
Converting String to Int in Kotlin
Filed under Kotlin Strings
Learn how to convert Kotlin Strings to their corresponding Int values
Checking if a String is Empty in Kotlin
Filed under Kotlin Strings
Learn how to check if a string is empty or blank
Convert Array to List in Kotlin
Filed under Kotlin Collections
Learn a few ways to convert arrays to lists in Kotlin
Get the Name of the Currently Executing Function in Kotlin
Filed under Kotlin Concurrency
Learn few different approaches to get the name of the currently executing function
Convert Byte Arrays to Hex Strings in Kotlin
Filed under Kotlin Strings
Learn a couple of approaches to convert ByteArrays into hexadecimal strings in Kotlin
How Does String Interpolation Work in Kotlin?
Filed under Kotlin Strings
Learn how string interpolation in Kotlin works under-the-hood and take a look at possible future optimizations for the current implementation
Lambdas with Receivers in Kotlin
Filed under Kotlin Functions
Learn what lambdas with receivers are and how they result in more simplicity and readability
Difference Between Classes and Singleton Objects in Kotlin
Filed under Kotlin Classes and Objects
Learn how Kotlin classes and objects differ at both the language and bytecode levels.
Open Keyword in Kotlin
Filed under Kotlin Basics
Learn about inheritance rules and the open keyword in Kotlin
Varargs and Spread Operator in Kotlin
Filed under Kotlin Basics
Learn how to pass a variable number of arguments to functions in Kotlin
Type Aliases in Kotlin
Filed under Kotlin Basics
Learn about type aliases in Kotlin and their use cases
Initializing Empty Mutable Collections in Kotlin
Filed under Kotlin Collections
Learn how we can initialize mutable lists, maps, and sets with no elements
Static Initialization Block in Kotlin
Filed under Kotlin Classes and Objects
Learn how we can use companion objects to statically initialize a Kotlin class
Kotlin NullPointerException: Parameter specified as non-null is null
Filed under Kotlin Basics
Learn what happens when we store a null value into a non-null data type in Kotlin
Deprecation in Kotlin
Filed under Kotlin
Learn how Kotlin takes this simple deprecation idea from Java and takes it to a whole new level
Inline Functions in Kotlin
Filed under Kotlin Functions
Learn how to use inline functions in Kotlin
Operator Overloading in Kotlin
Filed under Kotlin Basics
Learn about the conventions that Kotlin provides for operator overloading