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

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 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

Difference Between Java, Core Java and Advance Java

Here you will learn about difference between java, core java and advance java. Mostly beginner java programmers have confusion about these 3 terms in their mind. Below I have explained them to clear their confusion. Java It is a high level programming language. Java is available in three flavors. Java Standard Edition (J2SE or JSE) Java Enterprise Edition (J2EE or JEE) Java Macro Edition (J2ME or JME) Java is a combination of above there things. Core Java (J2SE or JSE)

Read more

Can We Override static Method in Java?

Can we override static method? is another important java interview question. Lets first take a look on what is method overriding. Method Overriding: When parent and child class have methods with same signature then it is called as method overriding. At run time compiler decides which method to call depending upon object type. Also Read: Can We Overload main Method in Java? Can We Override static Method in Java? No, we can’t override static method. Static method is not a part of object,

Read more

Can We Overload main Method in Java?

Here you will get answer for very basic question asked by beginners i.e. can we overload main method in Java? A function is overloaded in java by changing the number of arguments or their type. The main method can also be overloaded in the same way we overload any other method. How Can We Overload main Method in Java? Take below example.

Output String args[] In above program there are 3 overloaded main methods. If you will run the program it

Read more
1 2