C# Test1

35 Questions | Attempts: 135
Please wait...
Question 1 / 36
🏆 Rank #--
Score 0/100

1. In a HashTable Key cannot be null, but Value can be.

Submit
Please wait...
About This Quiz
C Programming Quizzes & Trivia

2.

What first name or nickname would you like us to use?

You may optionally provide this to label your report, leaderboard, or certificate.

2. Which of the following describes the web services, its parameters & how to use it?

Submit

3. What is redefining a single method multiple times so that you can use the same method name, but vary the number and types of parameters?

Submit

4. Which of the following exception is thrown for explicit conversions?

Submit

5. Rearrange the stages of Garbage Collection process    1.Objects that are not referenced anymore are cleaned up    2.Garbage Collect constructs the active-object graph    3.Reset the Next Object Pointer so that the next object is allocated    4.Heap objects are compacted to eliminate heap fragmentation    

Submit

6. Which of the following statements are correct about an interface in C#.NET?
  1. A class can implement multiple interfaces.
  2. Structures cannot inherit a class but can implement an interface.
  3. In C#.NET, : is used to signify that a class member implements a specific interface.
  4. An interface can implement multiple classes.
  5. The static attribute can be used with a method that implements an interface declaration.

Submit

7. Identify approaches that help reduce data over the network(Choose any 3)

Submit

8. Which of the following statements are true about finally block? (Choose any 3)  

Submit

9. What is the definition of polymorphism?

Submit

10. Which of the following property gets the XmlReader to construct XmlValidatingReader?

Submit

11. Which of the following statements are correct?
  1. Data members ofa class are by default public.
  2. Data members of a class are by default private.
  3. Member functions ofa class are by default public.
  4. A private function of a class can access a public function within the same class.
  5. Member function of a class are by default private

Submit

12. Where can polymorphism be applied?(Choose any 3 options)

Submit

13. Which is the exception that is thrown when a non-fatal application error occurs?

Submit

14. Which of the following statements should be added to the subroutine fun( ) if the C#.NET code snippet given below is to output 9 13?
class BaseClass
{
    protected int i = 13;
}
class Derived: BaseClass
{
    int i = 9; 
    public void fun()
    {
        // [*** Add statement here ***]
    } 
}

Submit

15. What does the following code do? string contents = File.ReadAllText(fileNameWithPath):

Submit

16. What does FileStream objects do?

Submit

17. Which of the following is the necessary condition for implementing delegates?

Submit

18. Which of the following statements are correct about the this reference?
  1. this reference can be modified in the instance member function of a class.
  2. Static functions of a class never receive the this reference.
  3. Instance member functions of a class always receive a this reference.
  4. this reference continues to exist even after control returns from an instance member function.
  5. While calling an instance member function we are not required to pass the this reference explicitly.

Submit

19. Which of the following statements are correct about an ArrayList collection that implements the IEnumerable interface?
  1. The ArrayList class contains an inner class that implements the IEnumerator interface.
  2. An ArrayList Collection cannot be accessed simultaneously by different threads.
  3. The inner class of ArrayList can access ArrayList class's members.
  4. To access members of ArrayList from the inner class, it is necessary to pass ArrayList class's reference to it.
  5. Enumerator's of ArrayList Collection can manipulate the array.

Submit

20. How does the throw statement work in exception handling?

Submit

21. Which of the following statements is correct?

Submit

22. Assume class B is inherited from class A. Which of the following statements is correct about construction of an object of class B?

Submit

23. How do you create a Client proxy class in C# for XML web service?

Submit

24. Which of the following property specifies the type of validation that the XmlValidatingReader should perform?

Submit

25. What are your observations on the following code?(Choose any 2)    private void CheckForReferenceType<T>(T type) where T:class, IHoldVal    {     type.Val = 3;     }

Submit

26. Which of the following is the correct way to call subroutine MyFun() of the Sample class given below?
class Sample
{
    public void MyFun(int i, Single j)
    {
        Console.WriteLine("Welcome to IndiaBIX !");
    }
}

Submit

27. In which of the following collections is the Input/Output index-based?
  1. Stack
  2. Queue
  3. BitArray
  4. ArrayList
  5. HashTable

Submit

28. Which of the following is the correct way to access all elements of the Queue collection created using the C#.NET code snippet given below?

Submit

29. Storage or sucket based network streams

Submit

30. What are your observations on the following cod?(Choose any 2) using system; struct SimpleStruct { protected int xval; public int X { get { return xval; } set { if (value <100) xval = value; } } public void DisplayX() { Console.WriteLine("The stored values is:{0}, xval); } }  

Submit

31. Which of the following statements are correct about the delegate declaration given below?
    delegate void del(int i);
  1. On declaring the delegate a class called del will get created.
  2. The signature of del need not be same as the signature of the method that we intend to call using it.
  3. The del class will be derived from the MulticastDelegate class.
  4. The method that can be called using del should not be a static method.
  5. The del class will contain a one-argument constructor and an lnvoke() method.

Submit

32. What does the following code denote?(Choose any 2) public class Contact { public string Name {get;set;} public string Email{get;set;} public string Address{get;set;} public string City{get;set;} protected string FullAddress() { return Address+' '+City; } } class Customer : Contact { public string FullAddress() { string fullAddress =" "; //Some statement return fullAddress; } }

Submit

33. Which of the following will be the correct output for the C#.NET program given below?
namespace IndiabixConsoleApplication
{ 
    class Sample
    { 
        int i; 
        Single j; 
        public void SetData(int i, Single j)
        { 
            i = i;
            j = j;
        }
        public void Display()
        { 
            Console.WriteLine(i + " " + j);
        } 
    } 
    class MyProgram
    { 
        static void Main(string[ ] args)
        { 
            Sample s1 = new Sample();
            s1.SetData(10, 5.4f); 
            s1.Display(); 
        } 
    } 
}

Submit

34. What does SOAP Header element contain?

Submit

35. What are your obeservations on the following code?(Choose 2) private static object m_CustomersLock = new object(); private static List<string> m_Customers = new List<string>(); try { Monitor.Enter(m_CustomersLock); m_Customers.Add("General Electric"); }

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (35)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
In a HashTable Key cannot be null, but Value can be.
Which of the following describes the web services, its parameters...
What is redefining a single method multiple times so that you can use...
Which of the following exception is thrown for explicit conversions?
Rearrange the stages of Garbage Collection process...
Which of the following statements are correct about an interface in...
Identify approaches that help reduce data over the network(Choose any...
Which of the following statements are true about finally block?...
What is the definition of polymorphism?
Which of the following property gets the XmlReader to construct...
Which of the following statements are correct? ...
Where can polymorphism be applied?(Choose any 3 options)
Which is the exception that is thrown when a non-fatal application...
Which of the following statements should be added to the subroutine...
What does the following code do?...
What does FileStream objects do?
Which of the following is the necessary condition for implementing...
Which of the following statements are correct about the this...
Which of the following statements are correct about an ArrayList...
How does the throw statement work in exception handling?
Which of the following statements is correct?
Assume class B is inherited from class A. Which of the following...
How do you create a Client proxy class in C# for XML web service?
Which of the following property specifies the type of validation that...
What are your observations on the following code?(Choose any 2)...
Which of the following is the correct way to call subroutine MyFun()...
In which of the following collections is the Input/Output index-based?...
Which of the following is the correct way to access all elements of...
Storage or sucket based network streams
What are your observations on the following cod?(Choose any 2)...
Which of the following statements are correct about the delegate...
What does the following code denote?(Choose any 2)...
Which of the following will be the correct output for the C#.NET...
What does SOAP Header element contain?
What are your obeservations on the following code?(Choose 2)...
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!