S
sahel
Hi;
I write a program that it has error do u know how I could solve it
(& I don’t want public lastname)
using System;
namespace ConsoleApplication49
{
class Program
{
static void Main(string[] args)
{
info.Employee();
}
class info
{
private string[] lastname = new string[100];
static public void Employee()
{
for (int i = 0; i <3; i++)
{
Console.WriteLine("enter the last name :");
lastname = Console.ReadLine();
}
}
}
}
}
That error is here:
Error 1 An object reference is required for the non-static field,
method, or property 'ConsoleApplication49.Program.info.lastname'
I write a program that it has error do u know how I could solve it
(& I don’t want public lastname)
using System;
namespace ConsoleApplication49
{
class Program
{
static void Main(string[] args)
{
info.Employee();
}
class info
{
private string[] lastname = new string[100];
static public void Employee()
{
for (int i = 0; i <3; i++)
{
Console.WriteLine("enter the last name :");
lastname = Console.ReadLine();
}
}
}
}
}
That error is here:
Error 1 An object reference is required for the non-static field,
method, or property 'ConsoleApplication49.Program.info.lastname'