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 random value in the...
View ArticleWhat is Logback.xml Logging Framework? ConsoleAppender, FileAppender and...
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...
View ArticleLazy Creation of Singleton ThreadSafe Instance without Using Synchronized...
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 initialization. The...
View ArticleBest way to convert Primitive Array to List in Java and Classic toString(),...
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...
View ArticleIn Java how to join Arrays? 3 ways: Apache Commons ArrayUtils, Java 8 Streams...
In this tutorial we will go over different ways we can join Java Arrays. If you have any of below questions then you are at right place: How can I concatenate two arrays in Java?How to Merge Two...
View ArticleJava Primitive Data Types details
Java is a widely used programming language that is known for its simplicity and versatility. One of the fundamental concepts in Java is the data type, which defines the type of data that can be stored...
View ArticleMastering Multithreading: Demystifying Daemon Threads in Java
Learn Java daemon vs. non-daemon threads: termination impact & usage. Optimize concurrency efficiently. Difference between Daemon and Non Daemon thread in Java : Termination Behavior: Daemon...
View ArticleJava: How to Get Random Key-Value Element From HashMap
Is there a way to get the value of a HashMap randomly in Java? Of Course, below is a simple Java Code which represents the same. Also, at the end of program there is a bonus code to Shuffle complete...
View ArticleJava: Simple QR Code Generator Example – Create QR codes for free
Scan this: You will be redirected to https://crunchify.com QR code (abbreviated from Quick Response Code) is the trademark for a type of matrix barcode (or two-dimensional barcode) first designed for...
View ArticleHow to iterate through Java List? Seven (7) ways to Iterate Through Loop in Java
How to iterate through Java List? This tutorial demonstrates the use of ArrayList, Iterator and a List. There are 7 ways you can iterate through List. Simple For loop Enhanced For loop Iterator...
View ArticleIn Java How to convert Byte[] Array To String and String to Byte[]?
How to convert Byte[] Array to String in Java? How to convert UTF-8 byte[] to string? Convert Java Byte Array to String to Byte Array. String stores textual data and for storing binary data you would...
View ArticleHave you noticed Race Condition in Java Multi-threading Concurrency Example?...
Sometime back I’ve written an article on Producer Consumer Example and how to handle read/write operation better way in Java. On the similar note, in this tutorial we will discuss something on Race...
View ArticleSimple Scroll to Top Button in WordPress Footer without any JavaScript...
Scroll to Top / Back to Top button at the bottom of page is sometime very essential mainly if you have long posts. Here on Crunchify, we do have most of Java tutorials and Blogging tips and those are...
View ArticleIn Java How to Find Maximum Occurrence of Words from Text File?
In this Java tutorial, you will learn How to Find Maximum Occurrence of Words from given Text File? Here is a logic for getting top element: Create a class CrunchifyComparable that can store the...
View ArticleHow to Delete a Local Git Branch?
When working with Git, managing branches efficiently is crucial for keeping your repository clean and organized. If you no longer need a local branch, deleting it can help maintain clarity in your...
View ArticleHow to Optimize Code Using Binary Notation?
Efficient programming often involves optimizing code for speed and memory usage. One powerful but underutilized technique is leveraging binary notation to optimize operations at a low level. Binary...
View ArticleIn Java How to get list of files and search files from given folder?...
In this tutorial we will go over FilenameFilter interface to search a file and list of files with given file extension (i.e. .png, .jpg, .jpeg, .txt, .pdf). lifeFiles returns an array of abstract...
View Article