- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2617 Articles for Java
![Sunidhi Bansal](https://www.tutorialspoint.com/assets/profiles/124656/profile/60_131452-1581053210.jpg)
489 Views
We are given two data structures as linked list Let’s say, List_1 and List_2. The task is to merge the elements of linked list ‘List_2’ into the linked list ‘List_1’ at an alternate position and if we are left with the elements which can't be merged into ‘List_1’ then it will be printed as the ‘List_2’ remaining elements.For Example-:In −List_1 =List_2 =Out − Merged List is-:Explanation − we are given with two lists i.e. List_1 and List_2. We had merged the possible elements of list_2 into List_1 at alternate positions. So, elements after merging in List_1 are 10- >3->2->1->1->4->2->5->5 and in List_2 are ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
12K+ Views
In this post, we will understand the difference between checked and unchecked exceptions in Java.Checked ExceptionsThey occur at compile time.The compiler checks for a checked exception.These exceptions can be handled at the compilation time.It is a sub-class of the exception class.The JVM requires that the exception be caught and handled.Example of Checked exception- ‘File Not Found Exception’Unchecked ExceptionsThese exceptions occur at runtime.The compiler doesn’t check for these kinds of exceptions.These kinds of exceptions can’t be caught or handled during compilation time.This is because the exceptions are generated due to the mistakes in the program.These are not a part of the ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
467 Views
In this post, we will understand the difference between abstract class and interface in Java and C#.Abstract ClassIt contains the declaration and definition part.Multiple inheritance can’t be implemented using abstract class.It contains the constructor.It can also contain some static members.It can contain multiple types of access modifiers such as public, private, protected.The performance of an abstract class is very good, because it is quick.It is used to implement the core identity/functionality of a class.A class can use only one abstract class.If many implementations are same, and they have a common behaviour, it is suggested to use an abstract class.Abstract classes ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
15K+ Views
In this post, we will understand the difference between ‘static’ and ‘final’ keywords in Java.StaticIt can be applied to nested static class, variables, methods and block.It is not required to initialize the static variable when it is declared.This variable can be re-initialized.It can access the static members of the class only.It can be called only by other static methods.Objects of static class can’t be created.Static class can only contain static members.It is used to initialize the static variables.FinalIt is a keyword.It is used to apply restrictions on classes, methods and variables.It can’t be inherited.It can’t be overridden.Final methods can’t be ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
4K+ Views
In this post, we will understand the difference between packages and interfaces in Java.PackagesIt is a group of classes and/or interfaces that are together.It can be created using the "Package" keyword.It can be imported.It can be done using the "import" keyword.Examplepackage package_name; public class class_name { . (body of class) . }InterfacesIt is a group of abstract methods and constants.It can be created using the "Interface" keyword.It can be extended by another interface.It can also be implemented by a class.It can be implemented using the ‘implement’ keyword.Exampleinterface interface_name { variable declaration; ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
1K+ Views
In this post, we will understand the differences between ‘Extends’ and ‘Implements’ keyword.ExtendsUsing this, a class can be used as a base class, and another class inherits this base class.An interface can also inherit other interfaces using this keyword.Only one superclass can be extended by a class.Any number of interfaces can be extended by an interface.It is not required for the subclass (that extends a superclass) to override all the methods in the superclass.Following is an example of the extends keyword −Exampleclass Super { ..... ..... } class Sub extends Super { ... Read More
![Kiran Kumar Panigrahi](https://www.tutorialspoint.com/assets/profiles/390736/profile/60_2598-1635242143.png)
2K+ Views
A collection framework in Java consists of a set of classes and interfaces which helps in implementing various data structures. List and ArrayList belong to this collection framework. List is an interface and ArrayList is a class. Their main motto is to create a list data structure. List is a collection of ordered elements arranged using the concept of indexing. Arrays use the concept of dynamic array to store elements. What is a List in Java? A list is one of the interfaces of the collection framework. It stores objects in an ordered manner. Here, the elements are stored sequentially. ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
796 Views
In this post, we will understand the difference between HashMap and LinkedHashMap in Java.HashMapIn this structure, the order of insertion is not preserved.It uses the HashTable to store maps.It extends the ‘AbstractMap’.It implements the ‘Map’ interface.This was introduced in JDK 2.0.It has a relatively low overhead.LinkedHashMapIn this structure, the order of insertion is not preserved.It uses the HashTable and Linked List to store maps.It extends the ‘Hashmap’.It implements the ‘Map’ interface.This was introduced in JDK 4.0.It has a relatively higher overhead.This is because it has to maintain the order of entries in the map structure.Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
418 Views
In this post, we will understand the difference between iterator and enumeration interfaces in Java.IteratorIt is a universal cursor.It can be applied to all collection of classes.It contains the ‘remove’ method.It is not a legacy interface.It can be used to traverse over HashMap, LinkedList, ArrayList, HashSet, TreeMap, and TreeSet .It can perform modifications to perform operations on the collection while traversing through it.EnumerationIt is not a universal cursor.It is applied only to legacy classes.It doesn’t contain the ‘remove’ method.It is a legacy interface.This interface acts like a read-only interface.Hence, no modifications can be performed on a collection while traversing over ... Read More
![Pradeep Kumar](https://www.tutorialspoint.com/assets/profiles/483469/profile/60_891162-1657084658.jpg)
2K+ Views
Both HashMap and TreeMap are considered to be Map classes because they both carry out the responsibilities of the Map interface. A Map is an object that stores key-value pairs, in which there is only one instance of each key but there may be multiple instances of the value. The hash table is a type of data structure that is utilised by the HashMap class. As a form of data storage, the red-black tree is utilised by the TreeMap.What is a HashMap?A HashMap uses a data structure known as the hash table in order to store the map's key-value pair. ... Read More