C# Interview Questions - 5 | Snaprecruit.com

C# Interview Questions - 5 | Snaprecruit.com

C SHARP interview questions part 5

C SHARP interview questions part 5

Take as many assements as you can to improve your validate your skill rating

Total Questions: 20

1. Which of the following are the classes defined by the namespace System.Net:

Correct Answer is : int peek()

2. Which of the following are the interfaces defined by the namespace System.Net:

Correct Answer is : streams

3. Which of the following are the classes that support the standard HTTP protocol

Correct Answer is : Character stream

4. Which of the following class/classes supports the task of uploading and downloading the file:

Correct Answer is : all of the mentioned

5. How many ports of TCP/IP are reserved for specific protocols?

Correct Answer is : BitArray

6. How many bits are present in a single IP address?

Correct Answer is : IDictionaryComparer

7. Which of the following is the full form of DNS?

Correct Answer is : arr.Count

8. Which of the following classes is used to encapsulate IP address and DNS?

Correct Answer is : Perfectly workable code

9. Which of the following are the protocols defined by .NET runtime:

Correct Answer is : All of the mentioned

10. The operator used to access member function of a class?

Correct Answer is : Collection classes make use of efficient algorithms to manage the collection, hence improving the performance of the program

11. What is the most specified using class declaration ?

Correct Answer is : All of the mentioned

12. Select the output for the following set of code : class sample { public int i; public int j; public void fun(int i, int j) { this.i = i; this.j = j; } } class Program { static void Main(string[] args) { sample s = new sample(); s.i = 1; s.j = 2; s.fun(s.i, s.j); Console.WriteLine(s.i + " " + s.j); Console.ReadLine(); } }

Correct Answer is : It is a ordered collection

13. Which of following statements about objects in “C#” is correct?

Correct Answer is : equals()

14. “A mechanism that binds together code and data in manipulates, and keeps both safe from outside interference and misuse.In short it isolates a particular code and data from all other codes and data. A well-defined interface controls the access to that particular code and data.”

Correct Answer is : Compare()

15. Select the output for the following set of code : class z { public int X; public int Y; public const int c1 = 5; public const int c2 = c1 * 25; public void set(int a, int b) { X = a; Y = b; }  } class Program { static void Main(string[] args) { z s = new z(); s.set(10, 20); Console.WriteLine(s.X + " " + s.Y); Console.WriteLine(z.c1 + " " + z.c2); Console.ReadLine(); } }

Correct Answer is : StartsWith()

16. Correct way of declaration of object of the following class is ? class name

Correct Answer is : Trim()

17. The data members of a class by default are ?

Correct Answer is : value less than zero

18. Select the output for the following set of code : class z { public string name1; public string address; public void show() { Console.WriteLine("{0} is in city{1}", name1, " ", address); } } class Program { static void Main(string[] args) { z n = new z(); n.name1 = "harsh"; n.address = "new delhi"; n.show(); Console.ReadLine(); } }

Correct Answer is : boolean

19. What does the following code imply ? csharp abc; abc = new charp();

Correct Answer is : FALSE

20. The output of code is ? class test { public void print() { Console.WriteLine("Csharp:"); } } class Program { static void Main(string[] args) { test t; t.print(); Console.ReadLine(); } }

Correct Answer is : true true

Similar Interview Questions

    Search for latest jobs

    Icon
    Icon