Difference between JDK, JRE and JVM

This tutorial will help you to learn the difference between JDK, JRE and JVM. JDK Java Development Kit (JDK) is a kit which provides the environment to develop and execute java programs. It is the superset of JRE (Java Runtime Environment) and includes tools for developing, debugging and monitoring the java applications. JDK includes two things: Development Tools: To provide an environment to develop your java programs. JRE: To execute your java program. Development part is the one, which contains

Read more

Marker Interface in Java

Marker interface in Java is an empty interface having no fields or methods. Simply we can say that it’s an interface which is used to convey the JVM that a class executing an interface of this category will have some special behavior. Need for Marker Interface 1. Marker interface in java is used to point out to JVM that the class implementing marker interface will have some special characteristics. 2. Marker interface also endow a way to associate metadata with

Read more

Difference between Hashtable and HashMap in Java

Here you will learn about difference between Hashtable and HashMap in Java. Both Hashtable and HashMap are data-structure based upon hashing and implementation of Map interface, and almost seems to be similar but there is significant difference between both which is described as follows. Difference between Hashtable and HashMap in Java Characteristic Hashtable HashMap Synchronization Hashtable is  synchronized internally. Synchronization means that merely one thread can change that Hashtable at one time. Fundamentally it signify that  Hashtable will have to

Read more

Java Garbage Collection

This tutorial covers all the concepts about java garbage collection, what is garbage collection, its application, its advantages, how GC (garbage collection) works with JVM?. How to scrutinize the garbage collection process and finally the methods to do so. Java Garbage Collection Garbage is the heap of unreferenced objects which occupy memory space without any need. In java destruction of object from memory is done without human intervention by JVM. What is Garbage Collection in Java? When there is no reference

Read more

Difference between ArrayList and LinkedList in Java

Here you will learn about difference between arraylist and linkedlist in java i.e. arraylist vs linkedlist. Both ArrayList and LinkedList are similar in many ways like both implement List interface and are non-synchronized. But still there are various differences between them which I have discussed below. Also Read: Difference between ArrayList and Vector in Java Image Source Difference between ArrayList and LinkedList in Java ArrayList LinkedList Implementation ArrayList internally implements dynamic array to store elements. LinkedList internally implements doubly linked list

Read more

Java Program to Find Largest Number in Array Using Recursion

Here you will get java program to find largest number in array using recursion.

Output Given Array: 5 12 10 6 15 Largest Number is 15 Comment below if you have any queries regarding above program.

Read more

Java Program to Find Inverse of a Matrix

Here you will get java program to find inverse of a matrix of order 2×2 and 3×3. We can find inverse of a matrix in following way. First find the determinant of matrix. Calculate adjoint of matrix. Finally divide adjoint of matrix by determinant. Image Source Below I have shared program to find inverse of 2×2 and 3×3 matrix. Java Program to Find Inverse of a Matrix 2×2 Matrix

Output Enter elements of matrix row wise: 4 7 2

Read more

Bucket Sort in Java

Here you will learn about bucket sort in Java with program example. Bucket Sort is a sorting algorithm in which elements of given array are distributed into different buckets and then each bucket is sorted individually using some other sorting technique or recursively using bucket sort. An example is shown in following images. Program for Bucket Sort in Java Here in this program I have assumed that array elements are positive and less than 10.

Output Before sorting: 3

Read more
1 2 3 4 12