Core java
30 JanuaryHow to check if a file exists in Java
It is very easy to check if file exists or not in your file system. You can use java.io.File’s exists() method to check if file exists or not. Java program : package org.arpit.java2blog; import java.io.File; public class FileExistsMain { /* * @author Arpit Mandliya */ public static void main(String[] args) { System.out.println("-----------------"); // Read the […]
29 JanuaryHow to get size of file in java
In this post, we will see how to get size of file in java. We can directly use java.io.File ‘s length method to get its size in bytes. We can convert it to KB and MB accordingly. package org.arpit.java2blog; import java.io.File; public class GetSizeOfFileMain { public static void main(String[] args) { // Read the file […]
29 JanuaryJava get file extension
In this post, we will see how to get extension of file in java. As java.io.File does not provide any direct method for getting extension of file. This is used when you want to process file differently on the basis of its extension. I have worked on a project where I required this utility method. […]
25 JanuaryHow to convert String to Date in java
In this post, we will see how to convert String to Date object in java. It is used when we have formatted String and need to convert it to Date object.You may also check how to convert Date to String Java program: package org.arpit.java2blog; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class StringToDateExample { public static void […]
25 JanuaryHow to Convert Date to String in Java
In this post, we will see how to convert date to string in java. It is more of utility which is mostly used while displaying dates in different string formats while generating any pdf or excel reports.You may also check how to convert string to date Java program: package org.arpit.java2blog; import java.util.Date; import java.text.SimpleDateFormat; import […]
09 JanuaryEnergy Casino 30 bónusz beváltása – Lépésről lépésre útmutató
Sok játékosnak vannak kérdései az Energy casino promocios kod kapcsán, mielőtt befizetné az első euróját – itt vannak az őszinte válaszok. Ez az útmutató részletesen bemutatja, hogyan léphetsz be a világba, hogyan érvényesítheted az energy casino 30 bónuszt, és mire figyelj a játék során. Az energycasino platformján számos lehetőség vár, de a biztonságos és felelősségteljes […]
15 DecemberHow to find GCD and LCM of two numbers in java
In this post, we will see how to find Greatest common divisor(GCD) and Least Common Multiple(LCM) in java. GCD is calculated using Euclidean algorithm and LCM is calculated using reduction by GCD Eucid algo for calculating GCD is: Lets say , there are two numbers , a and b so GCD of two numbers = […]
07 DecemberGuide complet du bonus magical spin – astuces et stratégies
Ceci est un guide pratique étape par étape : inscription, vérification, bonus et paiements — sans fioritures. Que vous soyez débutant ou joueur expérimenté, ce tutoriel vous explique comment profiter pleinement du casino magical spin, avec un focus sur le bonus de bienvenue et les tours gratuits. Suivez ces instructions pour maximiser votre expérience. Checklist […]
05 DecemberBlockingQueue in java
BlockingQueue is introduced in java with concurrent package with ConcurrentHashMap. It is thread safe queue to put and take elements from it. BlockingQueue is special type of queue which is used when one thread produces object and another thread consumes it. Producer thread will keep inserting objects to queue until it reaches upper limit. Once […]