.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> .NET Framework >> Post New Question Subscribe to Interview Questions

Why do we use Option Explicit?

Posted By :Shashi Ray     Posted Date :December 02, 2009    Points :10   Category :.NET Framework 
Correct answer is - This statement force the declaration of
variables in VB before using them.

You can also find related Interview Question to Why do we use Option Explicit?  below: 

What is the use of Option explicit?

  
Variable must be compulsorily declared when the Option Explicit is termed as ON. If it is OFF, variables can be used without declaration. (More...)

What is the use of Option explicit?

  
Variable must be compulsorily declared when the Option Explicit is termed as ON. If it is OFF, variables can be used without declaration (More...)

What optimizations does the C# compiler perform when you use the /optimize+ compiler option?

  
The following is a response from a developer on the C# compiler team: We get rid of unused locals (i.e., locals that are never read, even if assigned). We get rid of unreachable code. We get rid of try-catch with an empty try. We get rid of try-finally with an empty try. We get rid of try-finally with an empty finally. We optimize branches over branches: gotoif A, lab1 goto lab2: lab1: turns into: gotoif !A, lab2 lab1: We optimize branches to ret, branches to next instruction, and branches to branches. (More...)

Which option is used to drop constraints specified on the table?

  
DROP option in the ALTER TABLE command is used to drop constraints specified on the table. (More...)

What is the CIL representation of implicit and explicit keywords in C#?

  
The CIL representation is op_Implicit and op_Explicit respectively. (More...)

What is the advantage of specifying WITH GRANT OPTION in the GRANT command?

  
The privilege receiver can further grant the privileges he/she has obtained from the owner to any other user. (More...)

Consider the following code:

public class Example extends Thread
{
public void run()
{
System.out.println ("Hello");
}

public static void main (String args[])
{
new Example();
}
}

Select the correct option regarding the preceding code ?

  
1, The code will not compile.
2, The code will compile but will not execute.
3, The code will compile, execute, and display Hello as the output.
4, The code will compile, execute, but will not display anything.

Answer : 4 (More...)

Consider the following two classes:

public class Example1
{
public static int num;
static
{
num=5;
}
}


public class Example2
{
public static void main(String[] args)
{
System.out.println(Example1.num);
}
}

Select the correct option regarding the preceding classes.?

  
1, The Example2 class will execute without any output.
2, The Example2 class will execute with the following output:5

3, The Example2 class will not compile as it does not calls the constructor of the Example 1 class.
4, The Example2 class will not execute as it does not calls the constructor of the Example 1 class.

Answer : 2 (More...)

When retrieving List items using SharePoint Web Services, how do you specify explicit credentials to be passed to access the list items?

  
In order to specify explicit credentials with a Web Service, you generally instantiate the web service, and then using the credentials properties of the Web Service object you use the System.Net.NetworkCredential class to specify the username, password, and domain that you wish to pass when making the web service call and operations.
(More...)

What is Optional Explicit in VB.net ?

  
When a variable is assigned with Option Explicit the variable must and should be declared .

Use Option Explicit to avoid incorrectly typing the name of an existing variable or to avoid confusion in code where the scope of the variable is not clear. If you do not use the Option Explicit statement, all undeclared variables are of Object type.

Usage : Option Explicit On
(More...)

What is the benefit of using the WITH CHECK OPTION option in your view definition?

  
The option forces modification statements that are executed against the view to adhere to the criteria that is set within the SELECT statement that defines the view. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend