## Basic Hello World Java Program

In this post we will write a very basic Hello World Java program which gets printed on the console. Output:

## Fibonacci Series in Java

Fibonacci series is a series of numbers written in such a way that each number (leaving first two numbers 0, 1) is generated from the sum of previous two numbers. Ex: 0, 1, 1, 2, 3, 5, 8, 13, 21 Method 1: Simple but not optimal Method 2: Optimal References: Wiki Page – Fibonacci Number

## Check Leap Year in Java

Everyone knows that in a leap year we will have 29 days in February month. But how can we determine a leap year programmatically? Rules to identify a leap year Year should be divisible by 4 but not by 100, or Year should be divisible by 400 Program

## Computing Factorial in Java

Factorial of a positive integer n is multiplication of all positive integers from n till 1. Factorial is written as n!. 5! = 5 x 4 x 3 x 2 x 1 = 120 Factorial of zero is considered as 1 Finding Factorial using a loop Finding Factorial using Recursive Function

## Palindrome Numbers

What is a Palindrome Number? Palindrome number is a number which remains same even after reversing its digits. Case Examples Palindrome Number 121, 2332, 34543, etc. Non-Palindrome Number 122, 2335, etc Palindrome Number in Java Let’s print palindrome number list using a for loop. Palindrome Number in C language

## Swap Two Numbers

In this post, we will see examples on how to swap two numbers using a temporary variable and without using a temporary variable. Imagine you have red marbles in green glass and green marbles in red glass. How do you interchange the marbles so that red marbles will be in red glass and green marbles … Read more Swap Two Numbers