View Count: 0
Duration: 50 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 25 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 20 mins
Accessed date:
Not Yet Viewed
Post your comment / feedback here
 
 

Be the first one to comment about this video

Question No: 1 of 20
An Exception of type ________ is thrown if reference on RHS cannot be assigned to a reference variable on the LHS. 
Options:
  1. ArgumentNullException
  2. OverflowException
  3. InvalidCastException
  4. VerificationException
View Answer/Explanation:
c
Explanation:
InvalidCastException occurs when an explicit cast is applied to a type that is not in the same path of the type hierarchy.

Question No: 2 of 20
Unhandled exception in application are eventually handled by? 
Options:
  1. CLR
  2. Framework
  3. Compiler
  4. Operating System
View Answer/Explanation:
a
Explanation:
The Common Language Runtime will handle the exception and the program terminates. CLR manages the execution of programs written in any of .net supported languages, allowing them to share common object oriented classes.

Question No: 3 of 20
Exceptions in .net are interoperable (Exception thrown from code of one language can be handled in code of another language)? 
Options:
  1. True
  2. False
View Answer/Explanation:
a
Explanation:
Exceptions are managed by CLR which is language independent.

Question No: 4 of 20
static void Main(string[] args)
{
        try
        {
            int n1, n2;
            n1 = 10
            n2 = 0;
            int res = n1 / n2;
            Console.WriteLine("Result:" + res);
        }
        catch (DivideByZeroException ex)
        {
            Console.Write("One");
        }
        catch (Exception ex)
        {
            Console.Write("Two");
        }
}
What is the o/p of above program 
Options:
  1. One
  2. Two
  3. One Two
  4. 10
View Answer/Explanation:
a
Explanation:
Once the exception is handled by first catch it will not execute the subsequent catch block

Question No: 5 of 20
In .NET the base class for every exception is: 
Options:
  1. System.Type
  2. System.Exception
  3. System.ExceptionHandling
  4. System.ApplicationException
View Answer/Explanation:
b
Explanation:
Exception encapsulates all the data required for properly handling an exception in the catch block. System.Exception is the base class for all exceptions.

Question No: 6 of 20
In .net exceptions are ________ because it can encapsulate the data required for properly handling exception in catch block 
Options:
  1. Class
  2. Field member
  3. Variable
  4. Object
View Answer/Explanation:
d
Explanation:
Exception objects that describe an error are created and then thrown with the "throw" keyword. The runtime then searches for the most compatible exception handler.

Question No: 7 of 20
static void Main(string[] args)
{
        try
        {
            int n1, n2;
            n1 = 10
            n2 = 0;
            int res = n1 / n2;
            Console.WriteLine("Result:" + res);
        }
        catch (Exception ex)
        {
            Console.Write("One");
        }
        catch (DivideByZeroException ex)
        {
            Console.Write("Two");
        }
}
What is the o/p of above program 
Options:
  1. One
  2. Two
  3. One Two
  4. 10
View Answer/Explanation:
b
Explanation:
Once the exception is handled by first catch as Exception can handle all types of exception, subsequent catch block cannot execute.

Question No: 8 of 20
For a given try, the catch block of __________ class must be always after the catch block of ___________ class 
Options:
  1. parent, child
  2. child, parent
  3. child, child
  4. parent, parent
View Answer/Explanation:
a
Explanation:
Always the first matching catch block will execute. If the parent class catch block is provided, it will always execute the same catch and then subsequent child class catch block will never execute even if the exception thrown is of child class.

Question No: 9 of 20
Is a variable declared in try block accessible in catch block? 
Options:
  1. Yes
  2. No
View Answer/Explanation:
b
Explanation:
Try block ends with the starting of catch block so the scope of variables within try is limited to try block only.

Question No: 10 of 20
What is the o/p of following program:
static void Main()
{
	try {
		throw new SystemException("1");	
	}
	catch(Exception e) {
		Console.WriteLine("2");             
        	return;
	}
	finally
	{
		Console.WriteLine("3");
	}
} 
Options:
  1. 1
  2. 1 2
  3. 1 2 3
  4. 1 3
  5. 2 3
View Answer/Explanation:
e
Explanation:

  1