Java ConcurrentSkipListMap
Learn the Java ConcurrentSkipListMap and the major differences between ConcurrentSkipListMap and other Map implementations.
“Core Java” is Sun’s term, used to refer to Java SE, the standard edition and a set of related technologies, like the Java VM, CORBA, etc. This is mostly to differentiate from others like Java ME or Java EE. “Core Java” is Oracle’s definition and refers to subset of Java SE technologies.
The Core Java technologies and application programming interfaces (APIs) are the foundation of the Java Platform, Standard Edition (Java SE). They are used in all classes of Java programming, from desktop applications to Java EE applications.
Learn the Java ConcurrentSkipListMap and the major differences between ConcurrentSkipListMap and other Map implementations.
The OutOfMemoryError is a common issue in Java applications, occurring when the JVM cannot allocate enough memory to fulfill a request.
JWT tokens are commonly used in authentication and authorization processes to prove a user’s identity or grant access to specific protected resources.
JPAstreamer helps in fetching and processing the JPA or hibernate entities in the same way as we process the POJOs using Java 8 Stream API.
Learn to solve the Java compiler exception “Java class file has wrong version” while migrating an application to Spring 6 or Spring boot 3.
In Java, the volatile variables should be utilized when all changes made to a variable by one thread are immediately visible to other threads.
In Java, local variables are thread-safe because they are stored on the stack memory, which is a unique space allocated to each thread when it is created.
Learn to convert an array of primitives (int, long, float, double) to a List in Java using the iteration, Streams and open-source libraries.
Learn to handle the checked exceptions thrown from the methods used in Stream operations in Java 8 using safe method extraction and Optional.
Learn about the available zone ids and zone offsets in Java 8 or later. These zone ids and offsets represent an instant/timestamp that is local to the specified timezone. 1. Using ZoneId and ZoneOffset Java 8 introduced new date and time APIs (JSR-310), including ZoneId and ZoneOffset. In Java, the …
Learn to generate random numbers (ints, floats) in a range using new methods added in Java 8 in Random, SecureRandom and ThreadLocalRandom.
Learn to convert a specified Instant (in UTC) to ZonedDateTime (at some zone), and ZonedDateTime to Instant with easy-to-follow Java examples.
Learn to convert a given Instant to LocalDateTime, LocalDate, or LocalTime instances in the current system timezone or a specified timezone in Java. 1. Difference between Instant and LocalDateTime An Instant is an instantaneous point on the time-line without any timezone information associated with it. Internally, it uses the system …
Learn to convert a specified array of strings to an array of int or Integer values using Java 8 Streams and learn to handle invalid values.
The JMH error “Unable to find the resource: /META-INF/BenchmarkList” is mostly observed when we do not configure the compiler plugin.
Learn to mask a string or number with a mask character except the last 4 characters at the end, e.g., in account numbers and SSN.
Learn about Java Runnable and Callable Interfaces with simple examples and some of the main usages and differences between both interfaces.
Learn to implement the builder pattern style fluent API and copy constructors in Java records for creating immutable records with examples.
Learn what is a daemon thread in Java, how to create a daemon thread, and various methods present for daemon threads in the Thread class.
Learn to configure ‘Delete’ action with RollingFileAppender and DefaultRolloverStrategy which will delete the old logs after a certain time.
Learn to find the minimum value and the maximum value in a Map using Steam API, Collections API and simple comparison using iteration.
Comparing two Java lists with order ignored is a common requirement during JUnit tests where both lists come from different sources.
Learn to read or write a huge excel (.xlsx) files in Java using the fastexcel library, which is an excellent alternative for Apache POI.
Java UnsupportedOperationException is an unchecked exception and occurs when a requested operation is not supported in a class.
A Java List can be initialized in various ways. However, initializing a list with multiple elements can be a tedious task. This tutorial will discuss different techniques to initialize a list in one line to make your work easy and reduce boilerplate code. Method List Attributes Java Version List list …
Learn about Java ArrayDeque and its features with practical examples. Learn to use it as Stack and Queue, and the difference from LinkedList.
Java Microbenchmark Harness (JMH) is a tool that allows measuring various code performance characteristics and identifying bottlenecks with precision – up to the method level.
Java has 51 reserved words and 16 contextual keywords that cannot be used as identifiers in the code. Programmers should not use these keywords for other purposes.
Java IO is a collection of APIs targeted at reading and writing data from various sources to several targets. For example, we can read data from a file or over a network, write to a file or write a response back over the network. This page categorizes the various IO-related common tasks …
Java SynchronousQueue is a specific type of BlockingQueue with no internal capacity and is primarily used in exchanging data between two threads.
Learn Queue data structure and the Java Queue interface and implementations with practical examples such as LinkedList, PriorityQueue and ArrayDeque.
Learn about the new features and changes introduced in Spring 6 and Spring boot 3 such as baseline upgrade to Java 17 and removing all deprecated classes, methods and properties.
Java String class examples. Learn to create strings, methods, comparisons, formatting and various conversions with simple and easy to follow Java examples.
Learn to find a file by name in a given directory and its sub-directories in Java and search up to a configured depth of sub-directories with examples.
Learn to use Collectors.groupingBy() method to group and aggregate the Stream elements similar to ‘GROUP BY‘ clause in the SQL. Stream -> groupingBy() -> Map of elements after applying ‘group by’ operation 1. Collectors.groupingBy() Method 1.1. Syntax The groupingBy() method returns a Collector implementing a “GROUP BY” operation on Stream …
Learn to convert Map keys and values to the array, List or Set using the ArrayList and HashSet constructors as well as Stream APIs.
Learned the root cause and solution of the Java Stream exception “IllegalStateException: stream has already been operated upon or closed”.
Learn InterruptedException and when it is thrown with examples. We will also see how we can handle this exception in our code.
Learn what a Semaphore and a Reentrant Lock are along with practical examples. We will also explore some of the main differences between the two and the use cases where we can use these while working in a multithreaded application. 1. What is a Semaphore? A Semaphore is a Thread …
Learn to remove all the occurrences of an element from a given List using Java loops, list methods and Stream API.
Flattening a nested list may seem hard at the beginning, but it’s not. It can be easily done using only plain Java, streams, or external libraries.
Object-oriented programming (OOP) is a programming model that organizes software design around data or objects. Learn how Java supports OOP.
Learn to convert a List to a Map in Java using Streams, Commons collections, and Guava including Multimap class for duplicate list items.
Java Streams have gained a lot of awareness and being able to iterate through with indices can be helpful. Learn a few ways with examples.
Learn to remove and update elements of a Collection using Stream.filter() and Strea,map() methods in Java with examples.
Learn to create a List from array using Arrays.asList(array) and new ArrayList(Arrays.asList(array). Learn their differences with examples.
Learn to convert a given Java object into a Map using different solutions including Jackson ObjectMapper, Gson and Java reflection.
Learn to filter a Java HashMap by List of keys and collect the matching entries into a submap or matching values in a List.
Learn IllegalMonitorStateException, when it is thrown with examples. We will also see how we can prevent our code from raising this exception
Learn to round off a given floating point number to 2 decimal points in Java. As the best practice, always use the Decimal class with rounding mode set to HALF_EVEN.
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.