C# Interview Questions - 10 | Snaprecruit.com

C# Interview Questions - 10 | Snaprecruit.com

C SHARP interview questions part 10

C SHARP interview questions part 10

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

Total Questions: 20

1. Which statement correctly defines Interfaces in C#.NET?

Correct Answer is : 5 4 3 2 1

2. Which of the following cannot be used to declare an interface correctly?

Correct Answer is : Code give output as 55

3. A class consists of two interfaces with each interface consisting of three methods.The class had no instance data. Which of the following indicates the correct size of object created from this class?

Correct Answer is : Only 2 is correct

4. Which of the following statements correctly define about the implementation of interface?

Correct Answer is : Stack overflow exception Condition generated

5. Which keyword is used for correct implementation of an interface in C#.NET?

Correct Answer is : B B B zero A A A

6. Choose the statements which makes interface different from classes?

Correct Answer is : for( ;’0′; )

7. Which of the following is the correct way of implementing an interface addition by class maths?

Correct Answer is : j = 0;

8. Does C#.NET support partial implementation of interfaces?

Correct Answer is : -10 -9 -8 -7 -6 -5 -4 -3 -2 -1

9. Select the correct implementation of the interface which is mentioned below. interface a1{ int fun(int i);}

Correct Answer is : delegate

10. Which of these can be used to fully abstract a class from its implementation?

Correct Answer is : delegate

11. Access specifiers which can be used for an interface are?

Correct Answer is : none of the mentioned

12. Select the class which is the base class for all arrays in C#?

Correct Answer is : parameterized types

13. Choose the correct statement about the IComparer interface in C#:

Correct Answer is : No

14. What does the following property defined in the array class defines in C#? public bool IsReadOnly { get; }

Correct Answer is : All of the mentioned

15. What does the following property define in C#? public static int BinarySearch(T[] array, int index, int length, T value)

Correct Answer is : Generics class declaration

16. What will be the output of given code snippet? static void Main(string[] args) { int[] nums = { 5, 4, 6, 3, 14, 9, 8, 17, 1, 24, -1, 0 }; Array.Sort(nums); int idx = Array.BinarySearch(nums, 14); if (idx == 9) { Console.WriteLine(Convert.ToBoolean(1)); } else { Console.WriteLine(Convert.ToBoolean(0)); } Console.WriteLine("Index of 14 is " + idx); Console.ReadLine();}

Correct Answer is : Generic constructor declaration

17. What will be the output of the given code snippet? static void Main(string[] args) { string[] strings = {"beta", "alpha", "gamma"}; Console.WriteLine("Array elements: "); DisplayArray(strings); Array.Reverse(strings); Console.WriteLine("Array elements now: "); DisplayArray(strings); Console.ReadLine(); } public static void DisplayArray(Array array) { foreach (object o in array) { Console.Write("{0} ", o); } Console.WriteLine(); }

Correct Answer is : Gen

18. What will be the output of given code snippet? static void Main() { int[] nums = { 1, 2, 3, 4, 5 }; Console.Write("Original order: "); foreach(int i in nums) Console.Write(i + " "); Array.Reverse(nums); Console.Write("Reversed order: "); foreach(int i in nums) Console.Write(i + " "); Console.WriteLine(); }

Correct Answer is : Stack

19. Which of the classes provide the operation of reading from and writing to the console in C#.NET?

Correct Answer is : public name { /* … */ }

20. Which of the given stream methods provide access to the output console by default in C#.NET?

Correct Answer is : T

Similar Interview Questions

    Search for latest jobs

    Icon
    Icon