Find commong GCD for two numbers using recursion.

This is a simple program. Pasting it below. public class FindGCD {     public static void main (String s[]) {         System.out.println(gcd(48, 24));     }     public static int gcd (int x, int y) {         if (x > y) {             return findGcd (x, y);         } else {             return findGcd (y,x);         }     }     private static int findGcd (int l, int […]

Concept of Java : Difference between ‘==’ and equals

In Java, we compare two values using either ‘==’ or equals. Let’s see the difference between these two in this article. Before explaining the difference, I would like to explain what happens when we assign one value to another – for example, whey you say i = j where i might be a variable of […]

Introduction to Java – Part II

Object oriented programming languages like Java focuses on modeling of objects for developing an application. These objects can be defined by 2 characteristics : state and behavior. Here, let’s understand this with the help of an example.

Introduction to Java – Part I

Java, on the whole, can be divided into 2 parts : Programming language – this is basically a specification which describes various rules for writing a program in Java Platform – this refers to the underlying system for running a Java application.