What is the difference between a variable and a literal?



What is the difference between a variable and a literal?..

Answer / Manoj Kumar Raman

In C#, a variable is a named memory location where you can store data and change its value during runtime. A literal is a specific value of a data type that is directly assigned to a variable or used in an expression at compile time, such as 5, "Hello", true.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Can you prevent your class from being inherited and becoming a base class for some other classes?

2 Answers   Mind Tree,


What's difference about switch statements in C# ?

1 Answers  


What is the use of private constructor in c#?

1 Answers  


What is the difference between field and variable in c#?

1 Answers  


What is a streamwriter in c#?

1 Answers  


Why we use extension methods in c#?

1 Answers  


In dynamic link library, which api is used for load library?

1 Answers   C DAC,


What is difference between mutable and immutable in c#?

1 Answers  


What is raise event and what is its use?

1 Answers   Wipro,


What is console application with example?

1 Answers  


Differentiate between object pooling and connection pooling in c#?

1 Answers  


What is variable in c#?

1 Answers  


Categories