A compiler is a translator which transforms source language (high-level language) into object language (machine language). In contrast with a compiler, an interpreter is a program which imitates the execution of programs written in a source language. Another difference between Compiler and interpreter is that Compiler converts the whole program in one go on the other hand Interpreter converts the program by taking a single line at a time. Evidently, the perceivability of humans and an … [Read more...]
Difference Between Stack and Queue
Stack and Queue both are the non-primitive data structures. The main differences between stack and queue are that stack uses LIFO (last in first out) method to access and add data elements whereas Queue uses FIFO (First in first out) method to access and add data elements. Stack has only one end open for pushing and popping the data elements on the other hand Queue has both ends open for enqueuing and dequeuing the data elements. Stack and queue are the data structures used for storing … [Read more...]
Difference Between malloc and calloc
The fundamental difference between malloc and calloc function is that calloc() needs two arguments instead of one argument which is required by malloc(). Both malloc() and calloc() are the functions which C programming language provides for dynamic memory allocation and de-allocation at run time. Before understanding malloc() and calloc() functions first let us understand meaning of dynamic memory allocation. Memory allocation is the procedure of assigning the computer memory for the … [Read more...]
Difference Between Iterator and ListIterator in Java
The Iterator and ListIterator are the two among the three cursors of Java. Both Iterator and ListIterator are defined by Collection Framework in Java.Util package. ListIterator is the child interface of Iterator interface. The major difference between Iterator and ListIterator is that Iterator can traverse the elements in the collection only in forward direction whereas, the ListIterator can traverse the elements in a collection in both the forward as well as the backwards direction. Let … [Read more...]
Difference Between ArrayList and LinkedList in Java
ArrayList and LinkedList are the Collection classes, and both of them implements the List interface. The ArrayList class creates the list which is internally stored in a dynamic array that grows or shrinks in size as the elements are added or deleted from it. LinkedList also creates the list which is internally stored in a Doubly Linked List. Both the classes are used to store the elements in the list, but the major difference between both the classes ArrayList and LinkedList is that … [Read more...]
Difference Between HashMap and TreeMap in Java
HashMap and TreeMap are the Map classes and both implements the Map interface. Map is an object that stores key-value pairs, where each key is unique and but there may be duplicate values. The HashMap class uses the hash table as a data structure. The TreeMap uses the red-black tree as a data structure. The main difference between HashMap and Treemap is that the HashMap does not preserve the insertion order whereas, the Treemap does. So let us begin our discussion on the differences between … [Read more...]
Difference Between Iterator and Enumeration Interface in Java
The three cursors that are used to access the elements from any collection one by one are Enumeration, Iterator and ListIterator. Though, Iterator and Enumerator are meant for performing the same work. Still, they are distinct from each other in a sense that Enumeration has read-only access to the elements in the collection. On the other side, Iterator can read as well as remove the elements from the collection. The important difference between the Iterator and Enumeration is that the … [Read more...]
Difference Between sleep() and wait() Method in Java
The method sleep and wait sounds like doing the same task, but they are much different from each other. Sleep method belongs to the Thread class, and the wait method belongs to the Object class. The most important difference that distinguishes both of them is, the sleep method holds the lock on the object till it is interrupted or it finishes its execution. On the other hand, the wait method releases the lock on the object to let the other objects execute till is resumed by the notify method. … [Read more...]
Difference Between HashMap and LinkedHashMap in Java
HashMap and LinkedHashMap are the classes, quite similar to each other and are used for creating a map. HashMap class extends the AbstractMap class to use a hash table to store the elements in the map. LinkedHashMap class maintains the entries in the map based on their insertion order. The feature that distinguishes HashMap and LinkedHashMap from each other is that Hashmap does not maintain the order of the stored entries in a map. On the other hand, LinkedHashMap uses a hybrid data structure … [Read more...]
Difference Between List and ArrayList in Java
List and ArrayList are the members of Collection framework. List is a collection of elements in a sequence where each element is an object and elements are accessed by there position (index). ArrayList creates a dynamic array of objects that increases or reduces in size whenever required. The primary difference between List and ArrayList is that List is an interface and ArrayList is a class. Let us study the difference between the List and ArrayList with the help of comparison chart shown … [Read more...]
- « Previous Page
- 1
- …
- 4
- 5
- 6
- 7
- 8
- …
- 12
- Next Page »