
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
What is the difference between declaration and definition in C#?
Declaration means that variable is only declared and memory is allocated, but no value is set.
However, definition means the variables has been initialized.
The same works for variables, arrays, collections, etc.
Variables
Declaring a variable.
int x;
Let’s define and assign a value.
x = 10;
Arrays
Declaring an array.
int [] n // declaring int n= new int[10]; // initializing
Let’s assign a value.
n[0] = 100; n[1] = 200
- Related Questions & Answers
- What is the difference between a definition and a declaration in C++?
- Explain the Difference Between Definition and Declaration
- Difference between Definition and Declaration in Java.
- What is the difference Between C and C++?
- What is the difference between JavaScript and C++?
- What is the difference between | and || operators in c#?
- What is the difference between C++0x and C++11?
- What is the difference between ++i and i++ in c?
- What is the difference between literal and constant in C++?
- What is the difference between ++i and i++ in C++?
- What is the difference between objects and classes in C#?
- What is the difference between overriding and hiding in C#?
- What is the difference between overriding and shadowing in C#?
- What is the difference between String and string in C#?
- What is the difference between literal and constant in C#?
Advertisements