I'm starting to study C # and I get the following error:
CODE: CS0120
DESCRIPTION: An object reference is required for the non-static field, method, or property 'Program.SomarNumeroes (int, int)'
CODE: CS0120
DESCRIPTION: An object reference is required for the non-static field, method, or property 'Program.dizOla ()'
namespace metodo_e_funcao
{
class Program
{
public int SomarNumeros(int a, int b)
{
int resultado = a + b;
if (resultado > 10)
{
return resultado;
}
return 0;
}
public void dizOla()
{
Console.WriteLine("Ola");
}
static void Main(string[] args)
{
int resultado = SomarNumeros(10,11);
Console.WriteLine(resultado);
dizOla();
}
}
}