M
Marco
When compile I get this error:
An object reference is required for the nonstatic field, method, or
property 'ConsoleApplication1.Obj.env'.
I must do a static member that return a Obj instance.
Please help me.
public class tryClass
{
tryClass()
{
}
}
public class Obj
{
public tryClass env;
public static Obj fun(String a)
{
Obj MyObj = new Obj();
MyObj.i = 9;
MyObj.env=env;
return MyObj;
}
}
static void Main(string[] args)
{
Obj f=Obj.fun("lupo");
}
An object reference is required for the nonstatic field, method, or
property 'ConsoleApplication1.Obj.env'.
I must do a static member that return a Obj instance.
Please help me.
public class tryClass
{
tryClass()
{
}
}
public class Obj
{
public tryClass env;
public static Obj fun(String a)
{
Obj MyObj = new Obj();
MyObj.i = 9;
MyObj.env=env;
return MyObj;
}
}
static void Main(string[] args)
{
Obj f=Obj.fun("lupo");
}