Tag: programming languages

Questions Related to programming languages

  1. Is a class a subclass of itself?
  1. True

  2. False


Correct Option: B
  1. Can a method be overloaded based on different return type but same argument type ?
  1. True

  2. False


Correct Option: B
  1. Is null a keyword?
  1. True

  2. False


Correct Option: B
  1. Which non-Unicode letter characters may be used as the first character of an identifier?
  1. #

  2. $

  3. _

  4. @


Correct Option: B,C

How do you enable Strict Type Checking in VB.NET

  1. With OPTION STRICT ON keyword

  2. With OPTION EXPICIT Keyword

  3. With OPTION STRICT OFF keyword

  4. All the above


Correct Option: A
Explanation:

To enable Strict Type Checking in VB.NET, you need to use the "Option Strict On" keyword. This will enforce data type checking for all variables, parameters, and return types in your code.

Option Explicit, on the other hand, enforces explicit declaration of all variables in your code.

Option Strict Off disables strict type checking and allows automatic type conversions, making it easier to write code but potentially less safe.

Therefore, the correct answer is:

The Answer is: A. With OPTION STRICT ON keyword

How do you add Web Methods in VB.Net

  1. Add keyword to Method signature

  2. Add [WebMethod] on top of the Method Signature

  3. Add {WebMethod} on top of the Method Signature

  4. None of the Above


Correct Option: A

AI Explanation

To add web methods in VB.Net, you need to add the [WebMethod] attribute on top of the method signature. This attribute is used to indicate that the method can be invoked from a web service.

Let's go through each option to understand why it is correct or incorrect:

Option A) Add keyword to Method signature - This option is incorrect because there is no specific keyword to add to the method signature to indicate a web method in VB.Net.

Option B) Add [WebMethod] on top of the Method Signature - This option is correct because adding the [WebMethod] attribute on top of the method signature is the correct way to indicate that the method is a web method in VB.Net.

Option C) Add {WebMethod} on top of the Method Signature - This option is incorrect because the correct syntax for adding attributes in VB.Net is to use square brackets ([ ]), not curly brackets ({ }).

Option D) None of the Above - This option is incorrect because option B, which suggests adding [WebMethod] on top of the method signature, is the correct way to add web methods in VB.Net.

Therefore, the correct answer is B) Add [WebMethod] on top of the Method Signature.

  1. Using Only Get..EndGet with in property definition

  2. Using Only Set..EndSet with in property definition

  3. Using both Get and Set

  4. None of these


Correct Option: A

How do you terminate code execute with in a VB.NET method

  1. Exit

  2. Close Sub

  3. Exit Sub

  4. Kill


Correct Option: C