AmitDiwan has Published 10744 Articles

Difference Between if-else and switch

AmitDiwan

AmitDiwan

Updated on 24-Mar-2021 13:35:16

2K+ Views

In this post, we will understand the difference between if-else statement and ‘switch’ statement.If-elseDepending on the expression inside the statement, output would be generated.It uses multiple statements for multiple choices.This statement tests for equality.It can be used to test logical expressions.It can evaluate integer, character, pointer, floating-point type and boolean ... Read More

Difference Between exit(0) and exit(1)

AmitDiwan

AmitDiwan

Updated on 24-Mar-2021 13:31:28

2K+ Views

In this post, we will understand the difference between exit(0) and exit(1).exit(0)It is portable.It tells about the successful termination or completion of the program.It tells about the termination when the program is executed without any errors.The ‘EXIT_SUCCESS’ macro is used to return code 0.The ‘EXIT_SUCCESS’ can be defined as standard ... Read More

Difference Between Character Array and String

AmitDiwan

AmitDiwan

Updated on 24-Mar-2021 13:31:06

10K+ Views

In this post, we will understand the difference between character array and string.StringsThey are immutable.Once they are defined, they can’t be changed.It refers to a sequence of characters, which is represented as a single data type.It contains built-in functions such as substring(), charAt().The ‘+’ operator can be used to append ... Read More

Difference Between Inline and Macro in C++

AmitDiwan

AmitDiwan

Updated on 24-Mar-2021 13:24:36

1K+ Views

In this post, we will understand the difference between inline and macro in C++.InlineIt is a function in C++.It is parsed by the compiler.It can be defined inside or outside the class.It evaluates the argument only once.The compiler may not convert all functions to ‘inline’ function and expand them all.The ... Read More

Difference Between Checked and Unchecked Exception in Java

AmitDiwan

AmitDiwan

Updated on 24-Mar-2021 13:17:47

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

Difference Between Interface and Abstract Class in Java & C#

AmitDiwan

AmitDiwan

Updated on 24-Mar-2021 13:13:43

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

Difference Between ref and out in C#

AmitDiwan

AmitDiwan

Updated on 24-Mar-2021 13:09:58

907 Views

In this post, we will understand the difference between ‘ref’ and ‘out’ in C#.Ref keywordBefore passing the parameters to ‘ref’, they need to be initialized.It is not necessary to initialize the value of the parameter before it returns to the calling method.The data can pass in two directions when the ... Read More

Difference Between Delegates and Events in C#

AmitDiwan

AmitDiwan

Updated on 24-Mar-2021 13:06:37

2K+ Views

In this post, we will understand the difference between delegates and events in C#.DelegateIt can be declared using the ‘delegate’ keyword.It is a function pointer.It holds the reference to one or more methods during runtime.It is an independent keyword.It doesn’t depend on events.It contains the Combine() and Remove() methods that ... Read More

Difference Between Packages and Interfaces in Java

AmitDiwan

AmitDiwan

Updated on 24-Mar-2021 13:06:17

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

Difference Between Float and Double

AmitDiwan

AmitDiwan

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

1K+ Views

In this post, we will understand the difference between float and double data types.floatIt has a single precision.It takes 4 bytes of memory.According to IEEE, it has 32-bit precision.It is used with graphic based libraries.It improves the processing power of programs.It is simple to manage by compilers.Its value can be ... Read More

Advertisements