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

Difference between include directive and include action tag in JSP

  Both include directive and include action tag are used to include some jsp page, html page or text file inside another jsp page. Still there are several differences between them that I have explained in this tutorial. Difference between include directive and include action tag in JSP   S. No. include directive include action tag 1. It includes resource at translation time. Translation is the phase of jsp life cycle in which jsp is converted into servlet. It includes

Read more

String Constant Pool in Java

What is String Constant Pool in Java? It is a special memory area in Heap that contains references of string objects. There are two ways to create string object in Java. 1. Using string literal Example: String s = “java”; A string written inside double quotes is called string literal. Whenever we create string literal the JVM checks string constant pool. If the string is already present in pool then its reference is fetched. If the string is not present

Read more

Why Java Does Not Support Multiple Inheritance?

In this tutorial you will learn why java does not support multiple inheritance. It is a very popular and frequently asked java interview question. What is Multiple Inheritance? When a class inherits two or more classes then this scenario is called as multiple inheritance. Also Read: Why Java Does Not Support Pointers? Why Java Does Not Support Multiple Inheritance? Lets consider a situation to understand this. There are three classes A, B and C. A and B class contains a method

Read more

Why Java Does Not Support Pointers?

Below are some reasons why Java does not support pointers. Although there are various advantages of pointer but it has several disadvantages that I have mentioned in the article.     Simple The pointer concept is very confusing, difficult to understand (especially for beginners) and causes bugs in code. To make java simpler and less complex the java creators decided to remove the concept of pointers.   Secure Security is one of the biggest issue in programming world. Pointer provides

Read more