Check whether given integer number is prime or not in java (example)
Given an integer, check whether input number is prime or not. A prime number is a natural number greater than 1 […]
Given an integer, check whether input number is prime or not. A prime number is a natural number greater than 1 […]
Given a binary number, convert binary number to decimal number using java. We discuss various methods to convert binary number
The greatest common divisor (GCD) is the largest natural number that divides two numbers without leaving a remainder. e.g gcd ( 10,15) =
What is palindrome ? A palindrome is a word, number, phrase, or other sequence of characters which reads the same from
What is Square shape ? The square is a fundamental shape in geometry, characterized by several defining properties. It is
Given radius of circle, find out the area & circumference of circle in java (with example). Area of circle is PI * radius * radius
Given a length and breadth of a rectangle, find the area and perimeter of rectangle. Area of rectangle is length * breadth e.g if
Given base & height of triangle, calculate the area of triangle. Area of triangle = 0.5 * base * height. e.g
Given three sides of triangle, find the area of triangle using hero’s formula. Suppose a, b and c are the
Program to swap two numbers / variable without temporary or third variable in java using XOR , addition / subtraction , multiplication / division methods
What are even & odd numbers ? Given a number in java, check whether number is even or odd The
What is factorial of number? Factorial of a non-negative integer n, denoted by n!. Factorial is the product of all
Given a input number in java. Reverse input number using iterative or non recursive algorithm. e.g. if input number is
What is Fibonacci series? Fibonacci number is obtained by adding two preceding numbers. Fibonacci series is collection of fibonacci numbers. e.g. fibonacci
Given a String in java, reverse the String using standard java classes & recursive/iterative algorithm. e.g. reverse(“Lived”) = “deviL” reverse(“Star”) =
What is Fizz buzz game? FizzBuzz game is very famous interview question. Fizz buzz is a group word game used
The try-with-resources is try statement that used to declare one or more resources. e.g. resources like BufferedReader, Scanner, BufferedWriter can
What is exception (background)? Exception occurs in an application mostly due to programming mistakes. e.g. NullPointerException occurs, when we try
What is user defined or custom exception in java? User defined exceptions is concrete class extending exceptions like Exception, RuntimeException
Create a user defined exception in java. Create a custom exception, by extending unchecked exceptions. We will create CustomArithmeticException by extending
Given a message, We would like to encrypt & decrypt plain/cipher text using AES CBC algorithm in java. We will
Given a java application, We would like to read the property file defined in HOCON (Human-Optimized Config Object Notation.) or
What we will have in this post ? We will create a maven project and add apache shade plug-in. Create runnable
File read write IO operation in java using StringWriter & StringReader. StringWriter write contents as String & StringReader read file as String (example).
PrintWriter writes the formatted data to output stream. PrintWriter provides the methods to write int, boolean, char, String, double, float
Given the contents, we would like to create or write to file using CharArrayWriter class in java. Read contents from file
Given the UTF contents, read & write utf contents using BufferReader & BufferWriter. Use java nio feature to create BufferReader & BufferWriter.
Given UTF contents, read & write utf contents using BufferReader & BufferWriter in java. Write UTF contents to the file
Given the UTF contents, read & write utf contents using InputStreamReader & OutputStreamWriter. We have already discussed similar posts: Read & write UTF file
Read & write file using BufferedReader/BufferedWriter (NIO) with example. BufferWriter writes to character stream & BufferReader, reads character stream.