How to use net.jodah.ExpiringMap Maven Java Utility to Remove Expired Objects...
Java without Java Collection is really hard to imagine. I spend almost couple of hours a day working on Java Projects for my clients. HashMap, Map, Static Objects, Java Interface are the most commonly...
View ArticleJava Hashmap – containsKey(Object key) and containsValue(Object value) –...
There are few concepts and technologies which comes by default with each and every programing language and Collection is one of them. Java Collection is a very big field. It comes with so many...
View ArticleHow to Sort a HashMap by Key and Value in Java 8 – Complete Tutorial
In Java 8 – How to sort a Map? On Crunchify we have written almost ~400 java tutorials and this one is an addition to Java8 category. I love Java collection and have multiple tutorials on How to...
View ArticleHow to Implement Selection Sort Algorithm in Java – Detailed Explanation
Are you a Computer Science Graduate? Are you preparing for an Interview? Want to become a master in Data Structure? Well, Sorting algorithms are the most frequently asked questions in Java interview...
View ArticleEclipse: Missing web.xml file? How can I create web.xml in Eclipse?
Have you created Dynamic Web Project and created servlet and still are you missing web.xml file under \WebContent\WEB-INF\..? Eclipse allows you to NOT create a web.xml file when you create Dynamic Web...
View ArticleAds.txt (Authorized Digital Sellers) file and Google Adsense Revenue [All in...
Let me start with my recent experience with Ads.txt file. To be honest, I just came to know about it last week. It seems Ads is a short-name of Authorized Digital Sellers. It’s a new standard imposed...
View ArticleJava SSLSocket with TLS1.3 and TLS_AES_128_GCM_SHA256 Cipher Example
How to send TLS1.3 HTTPs request to your domain and print response? SSLSocket class extends Sockets and provides secure socket using protocols such as the “Secure Sockets Layer” (SSL) or IETF...
View ArticleJava Thread State Introduction with Example – Life Cycle of a Thread
Thread States The following diagram illustrates the various states that a Java thread can be in at any point during its life and which method calls cause a transition to another state. This diagram is...
View ArticleWrite Java Program to Print Fibonacci Series up-to N Number [4 different ways]
In mathematics, the Fibonacci numbers or Fibonacci series or Fibonacci sequence are the numbers in the following integer sequence: By definition, the first two numbers in the Fibonacci sequence are 0...
View ArticleJava Timer, TimerTask, Reminder Class Tutorial with Example
java.util.Timer is a utility class that can be used to schedule a thread to be executed at certain time in future. Java Timer class can be used to schedule a task to be run one-time or to be run at...
View ArticleHow to Implement your own InetAddress.isReachable(String address, int port,...
In Java there are multiple ways to check ping and port check. You could use system default’s ping command, Java’s native method InetAddress utility, HttpURLConnection and some more. In production or...
View ArticleSimplest way to generate logs in Java using java.util.logging’s...
Java comes with lots of utilities. In this tutorial we will go over simplest way to generate log files using SimpleFormatter and XMLFormatter. On Crunchify, we have published few tutorials about...
View ArticleWhat is Stack and How to implement Stack in Java without Collection?
What is Stack in Java? Have you heard of LIFO? Last-In, First-Out concept? Well, Stack is a LIFO implementation of linear Data Structure. That means, Objects can be inserted or removed from only one...
View ArticleHow to implement Stack in Java using Collection?
What is Java Stack and how to implement Java Stack without using any Collection or Utilities? Here is a tutorial which we published some time back. What is Stack and How to implement Stack in Java...
View ArticleIn Java How to find a Line with Maximum Number of Words? Using...
For any given file, Write a Java program to find a line with maximum number of words in it is a very common interview question. In other words, write a Java program to find longest line from file. In...
View ArticleIn Java How to Convert Char Array to String (four ways) – char[] to String()
Below are the four simple ways you can convert Char[] to String in Java. Using new String(char[]). Using String Constructor.Using valueOf(char[])Using StringBuilder()Create your own REGEX operation...
View ArticleIn Java How to Find List of all Class Names from inside .jar File? – Jar...
This tutorial will be very interesting. Last week I was working on a Java Project which requires me to have list of Classes from .jar file. With the help of JarEntry and JarInputStream utility I was...
View ArticleHow to add beautiful Link Underline Animation with simple CSS? (4 different...
Have you ever wondered how to add beautiful Link Underline Animation with simple CSS? Do you have any of below questions? How to Animating Link UnderlinesHow to Animated Multiline Link Underlines with...
View ArticleIn Java How to Set and Get Thread Priority? Get Thread ID, Count, Class,...
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...
View ArticleHow to align the Checkbox and Label in same line? CSS Fix
Recently we moved away from Disqus comment system and started using default WordPress comment system. For adding email subscription form for all new comments, I was facing some issue. Checkbox and...
View Article