Find LCM of two numbers using GCD in java (example)
LCM (Least common multiple) of two integers is the least positive integer that is divisible by both a and b. e.g […]
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 an array containing n-1 distinct positive numbers range from 1 to n. e.g suppose n = 5, array will contain 4 unique
Given an array of integer containing positive numbers. All number in an array is occurring even number of times except one
Given two input numbers, swap numbers using temporary variable. e.g. Given two input numbers x = 10 & y =
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
What is Open close software design principle? Benjamin disraeli said ‘Change is inevitable, Change is constant’. Change is constant in
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