My Report

C# Programming Practice Test 9


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. What kind of exception is being thrown if Wait(), Pulse() or PulseAll() is called from code that is not within synchronized code?

2. Which of the following class/classes supports the task of uploading and downloading the file?

3. Which is the correct statement about the namespaces in C#.NET?

4. What will be the output of the following C# code snippet?

 
#define DEBUG 
#define MYTEST
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication13
{
    class Program
    {   
        static void Main(string[] args)
        {
            #if (DEBUG && !MYTEST)
            Console.WriteLine("DEBUG is defined");
            #elif (!DEBUG && MYTEST)
            Console.WriteLine("MYTEST is defined");
            #elif (DEBUG && MYTEST)
            Console.WriteLine("DEBUG and MYTEST are defined");
            #else
            Console.WriteLine("DEBUG and MYTEST are not defined");
            #endif
            Console.ReadLine();
        }
    }
}

5. If a class named csharp is present in namespace n1 as well as in namespace n2, then which of the following is the correct way to use csharp class?

6. Which of these is a standard for communicating multimedia content over email?

7. Which of these method returns a smallest whole number greater than or equal to variable X?

8. What does the following C# code snippet specify?

public Thread(ThreadStart start)

9. Which of these data types can be used for a method having a return statement in it?

10. Which of these methods of Thread class is used to Suspend a thread for a period of time?


 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.