# Java Programming Tutorials

## Find all pairs of Elements in an Array whose sum is equals to a given number?

In this article we are going to discuss a problem from arrays; this is most commonly asked interview question of today. Problem For a given array of integers, you have to find all pairs of elements in this array whose sum is equals to a given number.

## Stack implementation in Java using Array - Sample Example

In this particular blog we will see Stack Implementation in Java using Array and a sample program to demonstrate push and pop functionality in Stack in Java.

## Find out duplicate number in an array, having n elements

We have an array of integer values such that it contains all numbers from 1 to n in order but any of the number is repeated, find out that repeated element. e.g. The input array of size 5 can have elements like {1,2,3,3,4} or {1,1,2,3,4}, so we have to find repeated element.

## Reverse a number without converting it to String

In this article we are going to discuss a problem from arrays; this is one of the most commonly asked interview question of today. Reverse a number without changing it to string and without using reverse().

## Find index in an integer array that divides the sum of elements both side equally

In this article we are going to discuss a problem from arrays; this is one of the most commonly asked interview question of today. Find index in an integer array that divides the sum of elements both side equally.

## Write a program in Java to print Fibonacci Series

In this article we are going to discuss a problem from arrays; this is one of the most commonly asked interview question of today. Write a program in Java to print Fibonacci Series, this can be done using an array.

## Write a program in Java to check if a number is a perfect number or not

In this article we are going to discuss a problem from number system; this is one of the most commonly asked interview question of today. Write a program in Java to check if a number is a perfect number or not. A perfect number is a number that is half the sum of all of its positive divisors. The first perfect number is 6, because 1, 2 and 3 are its proper positive divisors, and 1 + 2 + 3 = 6. Equivalently, the number 6 is equal to half the sum of all its positive divisors: ( 1 + 2 + 3 + 6 ) / 2 = 6.

## Write a program to find top two maximum numbers in an Array

In this article we are going to discuss a problem from arrays; this is one of the most commonly asked interview question of today. Write a program to find top two maximum numbers in an Array, without sorting the array and without using any collection.

## How to swap two numbers without using temporary variable?

In this article we are going to discuss a problem; this is one of the most commonly asked interview question of today. Write a program to swap two numbers without using a temporary variable.

## Write a program in Java to reverse a String without using reverse().

In this article we are going to discuss a problem from Java String; this is one of the most commonly asked interview question of today. Write a program in Java to reverse a String without using reverse() and without converting it to array.

## Write a program in Java to compare two Strings.

In this article we are going to discuss a problem from Java String; this is one of the most commonly asked interview question of today. Write a program in Java to compare two Strings.

## Write a program in Java to identify the last occurrence of a substring inside a given String.

In this article we are going to discuss a problem from Java String; this is one of the most commonly asked interview question of today. Write a program in Java to identify the last occurrence of a substring inside a String.

## Insertion Sort Algorithm - Implementation in Java

Insertion Sort is a vary simple sorting algorithm, that best suits for sorting small data list and inserting a new value in a already sorted list.

## Queue Implementation in Java using Array - Sample Example

In this particular blog we will discuss how to implement queue in Java using Array. Queue is a commonly used and efficient data structure.

## Linear and Binary Search Implementation in Java

In this tutorial we will come across Search Algorithms in Java and their Implementation. Linear Search and Binary Search are two commonly used Search Algorithms used in Java Programming.