
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 7442 Articles for Java

676 Views
We are given with an integer and the agenda here is to reverse the digits of the number and add the reversed number to the original number and check if the resultant number is a palindrome or not and the process is repeated until it does. The breaking point of the process is 1000 iterations and a value greater than the maximum long value( Long.MAX_VALUE).For ExamplesInput − 1678Output − Palindrome of the given input 1678 293392Explanation − The input number is first reversed and then added to the original number, it is then checked for palindrome if it is not a palindrome ... Read More

891 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

14K+ 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

702 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

5K+ 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

2K+ 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

3K+ 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

1K+ 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

566 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

3K+ 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