Create object/instance of class by name using Class.forName in java (examples)
Given an application in java. We would like to create the instance of classes by specifying class name. Instances of […]
Given an application in java. We would like to create the instance of classes by specifying class name. Instances of […]
We would like to list all available time zones supported by JDK. TimeZone represents a time zone offset, and also
We would like to get/set the default timezone in java. TimeZone represents a time zone offset, and also figures out
Given a local file present on our file system. We would like to convert path of a file to URL
Given a key value pairs of properties in java.Create or write or dump properties to property file using Properties class (example)
Given an array of user defined objects/POJO in java. We would like to sort user defined objects on certain properties/data
Given a source bean or object in java. We would like to copy properties from source bean into destination bean
Given Locale for given language & country code in java. We would like to display currency code & symbol for
Given a java application supporting different languages like French,German, Korean, Japanese, English etc. We will localize strings for each language
CopyOnWriteArrayList is thread-safe variant of ArrayList. New copy of underlying array is created when any add, set (or modification) operations
Scanner class is a text parser, which is used to parse primitives & strings using regular expression. Scanner split the
Scanner is text parser which used to parse primitives & strings using regular expression. Scanner split the input into token
Inter thread communication is very common phenomenon. There are many ways to achieve inter thread communication. In current post, we
Given a file in java, check read, write & execute permissions of a file. We would like to check whether
Create new file & directory/folder using File class in java (with example). We will create new directory & file using mkdir & createNewFile respectively
List all system drives in java. We will find out the free (available) , used and total space of each
Given a zipped or compressed file in java. Write a program to unzip or decompress the contents of zip file
Given an string representing unique identifier. We would like to convert string to corresponding universal unique identifier (UUID) or Globally
Universal unique identifier (UUID) or Globally unique identifier (GUID) is unique identifier (or Id). GUID represents the unique id(s). Typically
Generate guid or uuid using RandomBasedGenerator class of Java UUID Generator (JUG) library. In current post, we will generate random uuid
Generate time based uuid in java using JUG (Java Uuid Generator) library. JUG library provides couple of generator viz TimeBasedGenerator & RandomBasedGenerator. In
Given hostname in java, we would like to find out network details of host. JDK class InetAddress provide APIs to
Given a zipped or compressed file in java. We would like to display or list the contents of zipped file.
Given an input directory containing files and sub-directories. We would like to compress or zip all files present in a
Given the input files in java, create zip or compress files using ZipOutputStream class . Java framework has provided couple of
Given a standard error output stream, Write the standard error to a file in java. We will use System.setErr method to redirect std output to a file.
In java application, we write to console output using System.out.print*. We would like to redirect console output to a file.
Given an String variable in java, we would like convert String to integer using Integer.parseInt, Integer.valueOf or Integer constructor (with example)
Given input directory containing different files like image, video, text, csv, json etc. We would like to list files having
Given an input directory of given file system in java. We would like to list all files present in a