3
I’m starting to study C# and I’m making the following mistake:
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();
}
}
}
Got it understood, Thanks :D worked, from here 6 min I accept the answer
– kaiquemix