.NET - .NET Programming Concepts
Why should I learn to solve .NET: .NET Programming Concepts technical interview questions?
Learn and practise solving .NET: .NET Programming Concepts technical interview questions and answers to enhance your skills for clearing technical interviews, HR interviews, campus interviews, and placement tests.
Where can I get technical .NET: .NET Programming Concepts technical interview questions and answers with explanations?
IndiaBIX provides you with lots of fully solved .NET: .NET Programming Concepts technical interview questions and answers with a short answer description. You can download .NET: .NET Programming Concepts technical interview questions and answers as PDF files or e-books.
How do I answer .NET: .NET Programming Concepts technical interview questions from various companies?
You can answer all kinds of .NET: .NET Programming Concepts technical interview questions by practising the given exercises (short answer type). You can also find the frequently asked .NET: .NET Programming Concepts technical interview questions with answers from various companies, such as TCS, Wipro, Infosys, CTS, IBM, etc.
You can declare variables by using the following syntax:
<Data_type> <variable_name> ;
A constant is similar to a variable except that the value, which you assign to a constant, cannot be changed, as in case of a variable. Constants must be initialized at the same time they are declared. You can declare constants by using the following syntax:
const int interestRate = 10;
- Value type - Refers to the data type that contains the data. In other words, the exact value or the data is directly stored in this data type. It means that when you assign a value type variable to another variable, then it copies the value rather than copying the reference of that variable. When you create a value type variable, a single space in memory is allocated to store the value (stack memory). Primitive data types, such as int, float, and char are examples of value type variables.
- Reference type - Refers to a data type that can access data by reference. Reference is a value or an address that accesses a particular data by address, which is stored elsewhere in memory (heap memory). You can say that reference is the physical address of data, where the data is stored in memory or in the storage device. Some built-in reference types variables in .Net are string, array, and object.
Predict the output of the following code segment:
int x = 42;
int y = 12;
int w;
object o;
o = x;
w = y * (int)o;
Console.WriteLine(w);
/* The output of the code is 504. */