Select chapter



Basics (2.papers)
Data Types (2.papers)
enums (2.papers)
OOPS (4.papers)
Arrays (1.papers)
Structs (2.papers)
Properties (2.papers)
Strings (2.papers)
Interfaces (1.papers)
Constructors (2.papers)
Ref-Out-Keywords (1.papers)
Collections (2.papers)
Generics (1.papers)
Hide

Sponsored Links


  

c# basics interview questions and answers

1
What is a c# language ?
  1. C# pronounced as csharp is an object oriented programming language used for creating Microsoft .net applications .
  2. C# is a structural language used for creating .net applications.
Show Answer
Share Facebook gmail Twitter
2
What is a class in C# language ?
  1. Class is a virtual entity or model or template or blue print, using which we can create many objects.
  2. Class is a data type in c# language.
  3. Class do not occupy any memory in the RAM while executing the program.
  4. All the above statements are correct .
Show Answer
Share Facebook gmail Twitter
3
What is a data type?
  1. A data type is a container or a storage place for storing data.
  2. A data type is a program using which we can store numbers and strings only.
  3. A data type is a type, using which we can perform any task.
  4. None of the above.
Show Answer
Share Facebook gmail Twitter
4
Which of the following list of data types are supported in Csharp language?
  1. int, long, short, ushort, uint, ulong, byte, ubyte, char, bool, string.
  2. int, long, short, ushort, uint, ulong, byte, sbyte, char, bool, string, byte, array, float, double, decimal.
  3. int, long, short, ushort, uint, ulong, byte, sbyte, char, bool, string, byte, char, uchar.
  4. All the above list of data types are valid in c#.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
6
Which of the following statements is not correct about C# language ?
  1. C# language is case sensitive.
  2. C# language is object oriented programming language.
  3. C# language doesn't support multiple inheritance.
  4. C# language is just an extension to C language.
Show Answer
Share Facebook gmail Twitter
7
What is the difference between pascal casing convention and camel casing convention?
  1. As per Pascal casing starting character of every word must be in upper case . As per camel casing all character in first word must be lowercase and remaining words starting character must be uppercase.
  2. As per pascal casing all words starting characters must be upper case and in camel casing all characters must be in lower case.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
9
What is a primitive data type in Csharp ?
  1. A primitive data type is a data type present in MSIL language.
  2. A primitive data type is a data type in C# which is directly understandable by the C# compiler.
  3. Both Option1 and Option2 are correct.
  4. None of the above.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
11
What is the default value of bool in C# ?
  1. True
  2. 0
  3. False
  4. None of the above
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
13
What is the default value of string in C# ?
  1. Null
  2. Empty string
  3. Nothing
  4. None of the above
Show Answer
Share Facebook gmail Twitter
14
How to declare a method or function in C# ?
  1. accessspecifier  returntype  methodname (datatype variablename1,datatye variablename2,........)
    {
         return returnvalue ;
    }
    If there is no return value, then the returntype is void and return keyword should not be used inside the Method
Show Answer
Share Facebook gmail Twitter
15
How to call a function or method in C# ?
  1. For calling an instance method use objectname[dot]methodname(data1,data2...) .
  2. For calling a static method use Classname[dot]methodname(data1,data2...)
  3. For calling a method from another method, if both the methods are present in same class use methodname(data1,data2,......)
  4. All the above options are correct.
Show Answer
Share Facebook gmail Twitter
16
What is a strongly typed language ?
  1. Language in which a variable must be declared using an associated data type.
  2. Language which doesn't support implicit conversions of data types.
Show Answer
Share Facebook gmail Twitter
17
What is the output of the following for loop ?
for(int i=0;i<10; )
{
    Console.WriteLine(i);
}
  1. Program will print 0 infinite times.
  2. Program will give stackoverflow exception after printing 0 for few times.
  3. Compilation error.
  4. None of the above.
Show Answer
Share Facebook gmail Twitter
18
How many characters a string data type can store in C# ?
  1. A string data type can able to store any number of characters.
  2. A string data type can able to store only 10000 number of characters.
  3. A string data type can able to store only English alphabets and special character up to 1000 characters.
  4. None of the above.
Show Answer
Share Facebook gmail Twitter
19
Which Naming convention is used in csharp language ?
  1. 1.Use pascal casing for declaring class names, structures, method names, fields.
    2.Use camel casing for local variables.
  2. 1.Use camel  casing for declaring class names, structures, method names, fields.
    2.Use pascal casing for local variables.
  3. Use IEEE standards in C#.
  4. None of the above.
Show Answer
Share Facebook gmail Twitter
Read more papers :