Question:Consider the following code snippet:
namespace ExtensionMethods
{
public static class NumericExtensionMethods
{
  public static bool IsNumeric(this string s)
  {
    float output;
    return float.TryParse(s, out output);
  }
}
}
After adding the namespace, how will you call the ExtensionMethod on the string if your string variable is defined as: string test="4"; 

A test.IsNumeric(); 

B ExtensionMethods.NumericExtensionMethods.IsNumeric(); 

C NumericExtensionMethods m = new NumericExtensionMethods(); m.IsNumeric(test); 

D None of these 

+ Answer
+ Report
Total Preview: 716

Copyright © 2024. Powered by Intellect Software Ltd