## Addition of Two Numbers in Java

We will solve this basic problem of the addition of two numbers in three ways, first by using a Scanner, second by using BufferedReader, and at last by using command-line arguments. Addition of two numbers using Scanner Java provides Scanner class in java.util package. This class is very popular to read values from the user … Read more Addition of Two Numbers in Java

## Finding Maximum of Three Numbers in Java

In this post, we will see 2 variations of finding maximum of 3 numbers in Java: (A) Max value of 3, (B) Max variable of 3 numbers. Max Value of 3 Max Variable of 3

## How to Convert an Integer to Octal in Java

Java wrapper class Integer provides an utility function toOctalString(int) which returns an integer in octal form. However, in this post, we will also see an example on how we can convert integer to octal form mathematically without using Java API classes. If you divide a number with 8, what you get in the reminder is … Read more How to Convert an Integer to Octal in Java

## How to reverse an integer in Java

A number which doesn’t contain fractions is an integer, also called as whole number. In this post, we will see an example to reverse an integer mathematically. After dividing any integer with 10, we get reminder as its last digit and quotient as its first part of the number without last digit. Output: Dry Run: … Read more How to reverse an integer in Java

## Quick Sort in Java

Quick Sort is based on the divide and conquer strategy. It is also called as partition exchange sort. It was developed by Tony Hoare in 1959. Steps for Quick Sort: First step in Quick Sort is to choose an element called as pivot. Once the Pivot is selected, we need to reorder the elements so … Read more Quick Sort in Java

## Bubble Sort in Java

In Bubble Sort, we always compare one array element with its adjacent element. If the first element is greater than the next element, we swap both of them. These steps will be repeated several times to push all the big numbers to the end one after one. Program: Output: