Time based uuid generator in java (JUG library / example)
Generate time based uuid in java using JUG (Java Uuid Generator) library. JUG library provides couple of generator viz TimeBasedGenerator & RandomBasedGenerator. In […]
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
Given an input directory, List or print folders contained in a input directory path scope operator & file filter in java (IO operation /example)
Given an input directory or folder, we would like to list all files & folders in a directory. We will
Given a property file defining the properties of a java application. Property file will be residing in the resource folder/directory.
What thread’s join method? The join method allows one thread to wait for the completion of another thread. Suppose we
List all system fonts and font families using GraphicsEnvironment. We will iterate through system fonts and we will print the
Given a java program, where we are allocating memory in heap store. We will allocate array (array of long primitives).
We will get list of all environment variables using System class. We will iterate through the map of system variables
In current post, we will print /displays locales, country codes, country names and country languages. We will use Locale class
Print or list or display all system properties using forEach method java 8 streams lambda. Print key value pairs of properties in java
Given an input string in java, convert input string to character array. We will iterate through char array to print each character.
StringBuffer is a thread-safe, mutable sequence of characters. StringBuffer can be modified at any point of time. We will look
Given a String in java, we would like to convert the input String to lower case & upper case. String
Difference between equality operator & equals method in java. == operator is used to compare primitives & equals method is used to compare objects (example)
Given a decimal number (base 10), convert decimal integer to binary number (base 2) using java. We will discuss various
Given a hexadecimal number, convert hexadecimal number to decimal number using java. We will discuss various methods to convert hexadecimal
Given a decimal number (base 10), convert decimal to hexadecimal number (base 16) using java. We will discuss various methods to
LCM (Least common multiple) of two integers is the least positive integer that is divisible by both a and b. e.g
Given a string in java, reverse each word of string using StringBuilder in java. Let us look into couple of
Given a string in java, reverse the string word by word. Let us look into couple of examples to understand
Given two input numbers, swap numbers using temporary variable. e.g. Given two input numbers x = 10 & y =