Java Stream() is an amazing util class with lots of functionalities. We have published almost ~30+ Java8 Stream related tutorial on Crunchify and this one is on stream().boxed.collect() utility. We …
Java J2EE Tutorials • Category Archive
Java and J2EE tutorials are lessons and resources aimed at teaching individuals about the Java programming language and the Java 2 Platform, Enterprise Edition (J2EE) for developing enterprise applications. These tutorials cover various aspects of Java and J2EE, including the language syntax, object-oriented programming concepts, J2EE components and APIs, and best practices for developing enterprise applications.
They are designed for both beginners and experienced Java developers, and aim to help individuals gain the skills and knowledge needed to develop high-quality Java and J2EE applications.
Lazy Creation of Singleton ThreadSafe Instance without Using Synchronized Keyword
Sometime back I have written short article explaining Singleton Design Pattern. In which I've explained two ways to create Singleton pattern. Lazy Initialization and Runtime …
What is Logback.xml Logging Framework? ConsoleAppender, FileAppender and RollingFileAppender Example
Are you aware of Logback Logging Framework? Well, most of the people mainly use log4j and slf4j into their project. Since last 6 months I've been using Logback.xml logging framework and I would say I …
How to Generate Random Number in Java with Some Variations?
In Java, there is a method random() in the Math class, which returns a double value between 0.0 and 1.0. In the class Random there is a method nextInt(int n) , which returns a …
Read Article about How to Generate Random Number in Java with Some Variations? →
How to implement Bucket Sort Algorithm in Java? Detailed Explanation
Bucket sort is a sorting algorithm used to sort a collection of floating-point numbers into increasing order. The algorithm works by dividing the range of the input numbers into n buckets, where n …
Read Article about How to implement Bucket Sort Algorithm in Java? Detailed Explanation →
Finding the Middle Element of a Linked List in Java (Two Pointers and Size of LinkedList way)
A linked list is a data structure that consists of a sequence of nodes, where each node contains an element and a reference to the next node. In this post, we will see how to find the middle element …
In Java How to Set and Get Thread Priority? Get Thread ID, Count, Class, StackTrace, ThreadGroup and More
In Java multithreading programming, sometimes you may need to set Thread priority in order for it to execute before another thread. You can set and get Thread priority programmatically using …
Java NIO (Non-blocking I/O) with Server-Client Example – java.nio.ByteBuffer and channels.Selector – Java NIO Vs. IO
Java NIO is my favorite topic. I have been working with NIO since last 2 years and would like to share simple Server-Client code for my readers who are free to use this code in their production …
Java14 Synchronous HttpClient Example – Overview and Simple Tutorial – send()
Java recently released Java 14 JDK. In this tutorial we will go over Overview and Simple Java Synchronous HttpClient Client Tutorial. If you have any of below questions then you are at right …
Read Article about Java14 Synchronous HttpClient Example – Overview and Simple Tutorial – send() →
How to check if a file exists or not in Java? File.exists() and File.isFile() methods in Java
How to check if file exists in on file system? Sometime at runtime, you may have to find a file and make sure that exists before executing or running any command. You don't want to get an …
When Should I use CopyOnWriteArrayList Vs. ArrayList in Java? Avoid java.util.ConcurrentModification Exception
java.util.List is an ordered collection also known as a sequence. ArrayList is a very basic implementation of List. There are number of articles I've posted on Crunchify before on ArrayList …
How to stop/kill long running Java Thread at runtime? timed-out -> cancelled -> interrupted states
Have you ever wondered how to kill long running Java thread? Do you have any of below questions? Kill/Stop a thread after certain period of time Killing thread after some specified time limit …