Java NullPointerException – Reasons for Exception and How to Fix?

In this tutorial you will learn about Java NullPointerException and ways to fix this. A runtime error that can be handled by the programmer is called an Exception. Some exceptions that are checked at compile time are called Checked Exceptions, these also called compile time errors. But the term we are using Exception only refers to Unchecked exceptions which are checked by JVM but not by compiler. Java NullPointerException Java.lang.NullPointerException is one of the most common exception in Java that

Read more

Difference between Throw and Throws in Java

In this tutorial you will learn about difference between throw and throws keywords in java with example. When we run a java program which contains errors, programmers should handle errors by exception handling (using try, catch and finally blocks) or avoid (throw) it. Otherwise JVM will give error which causes the termination of the running program and loss of data that has been processed till that line of the program. Throw and Throws are two keywords used in java syntax

Read more

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
1 2 3 4 5 13