domenica 5 luglio 2009

How To: Crate a Static Method

Questo esempio mostra come creare un metodo Statico in una classe non statica.

public class Test
{
public static string staticMehotod(string value)
{
return "Parameter is :" + value;
}
}

public class useTest
{
public void UseStaticMethod()
{
string value = "Test";

Console.WriteLine(Test.staticMehotod(value));
}
}

Nessun commento: