Java Program to Find GCD of Two Numbers Using Euclidean Algorithm

Here you will get java program to find gcd of two numbers using recursion and euclidean algorithm. Greatest Common Division (GCD) of two numbers is largest number that divides both of them completely. GCD is also called as Highest Common Factor (HCF). There are various ways to find GCD but Euclidean Algorithm is the most efficient way. Euclid’s algorithm GCD of two numbers a and b can be obtained by following algorithm. gcd (a, b) = gcd (a – b, b),

Read more

Difference between Statement and PreparedStatement in Java

Here you will learn about difference between statement and preparedstatement in Java i.e. Statement vs PreparedStatement. The Java Database Connectivity (JDBC) API is essentially used to connect Java applications with databases. It could be any relational or OLAP database. The JDBC API offers different interfaces to connect to particular databases and execute numerous types of SQL queries such as follows: Statement PreparedStatement These JDBC interfaces offers different functionalities, properties and methods which enables us to connect to databases and execute

Read more

6 Best Java Books for Beginners in 2017

Here you will get list of 6 best java books for beginners. Java is a programming language which includes much more concepts compared to C, C++, etc. Java is an almost pure Object Oriented Programming Language. To master Java it requires guidance of good books and tutorials. For this purpose here are some books which are recommended by many java developers and instructors throughout the world. These java programming books will help you grasp the Java language concepts from Basic

Read more

Java Vigenere Cipher Program (Encryption and Decryption)

Here you will get program for vigenere cipher in Java for both encryption and decryption. Vigenere Cipher is a polyalphabetic substitution technique that is used for encrypting and decrypting a message text. In this technique we use a table of alphabets A to Z which are written in 26 rows which is also known as Vigenere Table. Also Read: Caesar Cipher in Java (Encryption and Decryption) Encryption Lets understand encryption by one example. Plain Text: THEJAVAPROGRAMMER Key: NEERAJ We have to generate a

Read more

Java Socket Programming (Client Server Program)

In this tutorial I have shared simple client server program example to explain java socket programming. In this example I will use Socket and ServerSocket classes for connection oriented socket programming. Since data is shared between server and client over network in the form of streams so DataInputStream and DataOutputStream classes are used. Java Socket Programming (Client Server Program) Server

Above code is used to create server which is running on localhost on port number 5000. Client

Since the server

Read more

Difference between Method Overloading and Method Overriding in Java

Here you will learn about difference between method overloading and method overriding in java with program examples. When a class have methods with same name but different arguments list then it is called method overloading. On the other hand if two classes (parent and child) have methods with same name and same arguments list then it is called method overriding. There are various other differences between them that are discussed below in tabular form. Difference between Method Overloading and Method

Read more

3 Best Java IDEs of All Time

Here I am sharing the list of top 3 best Java ides of all time. IDE is a combination of editor and compiler. It makes software development task little easier for programmers due its great features like code autocomplete, syntax highlighting, smart indentation, etc. For java there are various ides available in market and it become little difficult to decide best among them. To make your task little easier I have shared the list of some best java ides that

Read more

Static Keyword in Java

In this tutorial you will learn about static keyword in Java with example code. Static keyword in java mainly used for memory management process. In Java static keyword can be used in following cases. With Variables With Methods With Blocks With Nested Class Lets discuss each of them one by one. Static Keyword in Java Static Variable in Java We can declare static variable by simply writing static keyword before normal variable. Static variables are memory efficient as memory for

Read more
1 2 3 4 13