AmitDiwan has Published 10744 Articles

Difference between new and malloc( )

AmitDiwan

AmitDiwan

Updated on 24-Mar-2021 12:48:23

1K+ Views

In this post, we will understand the difference between ‘new’ and ‘malloc’.newIt is present in C++, Java, and C#.It is an operator that can be used to call the constructor of the object.It can be overloaded.If it fails, an exception is thrown.It doesn’t need the ‘sizeof’ operator.It doesn’t reallocate memory.It ... Read More

Difference Between dispose() and finalize() in C#

AmitDiwan

AmitDiwan

Updated on 24-Mar-2021 12:47:38

1K+ Views

In this post, we will understand the difference between the methods ‘dispose’, and ‘finalize’ in C#.DisposeThis method is defined in the IDisposable interface.It has to be invoked by the user.Whenever it is invoked, it helps free the unmanaged resources.It can be implemented whenever a close() method is present.It is declared ... Read More

Difference Between extends and implements keywords in Java

AmitDiwan

AmitDiwan

Updated on 24-Mar-2021 12:42:58

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 ... Read More

Difference Between HashMap and LinkedHashMap in Java

AmitDiwan

AmitDiwan

Updated on 24-Mar-2021 12:38:17

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 ... Read More

Difference Between Iterator and Enumeration Interface in Java

AmitDiwan

AmitDiwan

Updated on 24-Mar-2021 12:34:07

567 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 ... Read More

Difference Between malloc and calloc

AmitDiwan

AmitDiwan

Updated on 24-Mar-2021 12:31:57

902 Views

In this post, we will understand the difference between malloc and calloc.MallocThe method ‘malloc’ is used to assign a block of memory when it is requested.It doesn’t clear the memory.It only initializes the allocated memory when explicitly requested.It allocates memory of a specific ‘size’.This size is passed as parameter to ... Read More

Difference Between Stack and Queue

AmitDiwan

AmitDiwan

Updated on 24-Mar-2021 12:28:30

923 Views

In this post, we will understand the difference between Stack and Queue.StackThey are based on LIFO- Last In First Out.This means the element inserted at the end is the first element to get deleted.Insertion and deletion happen in a stack from one end only, i.e the top.Insert operation is known ... Read More

Difference Between Applet and Application

AmitDiwan

AmitDiwan

Updated on 23-Mar-2021 08:42:12

3K+ Views

In this post, we will understand the difference between Applet and Application.ApplicationThey are similar to Java programs.They can be executed independently without using web browser.It requires a ’main’ function for it to be executed.Java applications have full access to local file system and network.They can access all kinds of resources ... Read More

Difference Between Link and Association

AmitDiwan

AmitDiwan

Updated on 23-Mar-2021 08:01:46

12K+ Views

In this post, we will understand the difference between Link and Association.LinkIt can be understood as the physical connection between objects.It helps tell about the relationship among objects.It is represented using line segment between objects.They can’t be referenced.It is used in UML designs.AssociationIt is a specification about the collection of ... Read More

Difference Between Friend Function and Friend Class

AmitDiwan

AmitDiwan

Updated on 23-Mar-2021 08:01:22

6K+ Views

In this post, we will understand the difference between Friend function and Friend class.Friend FunctionIt is usually used with operator overloading operation.It is used with the ‘friend’ keyword.It helps give a non-member function the access to the private members of the class.It has to be declared before it is used.It ... Read More

Advertisements