Hi,
I am developing some windows application tool.Here my doubt is,
I have some 3 classes in the project,
class one
{
Public string getName()
{
return "Nags"
}
}
class three
{
public static object object1;
}
method one:
-----------------
class two
{
[STAThread]
static void Main()
{
one obj=new one()
MessageBox.Show (obj.getName);
}
}
methos 2:
---------------
class two
{
[STAThread]
static void Main()
{
two obj= (two)three.obje ct1;
MessageBox.Show (obj.getName);
}
}
In the above two methods which one is better?and tel me why?
if second one is better means what about the cpu usage(when i go for more objects)
Regards
Nags
I am developing some windows application tool.Here my doubt is,
I have some 3 classes in the project,
class one
{
Public string getName()
{
return "Nags"
}
}
class three
{
public static object object1;
}
method one:
-----------------
class two
{
[STAThread]
static void Main()
{
one obj=new one()
MessageBox.Show (obj.getName);
}
}
methos 2:
---------------
class two
{
[STAThread]
static void Main()
{
two obj= (two)three.obje ct1;
MessageBox.Show (obj.getName);
}
}
In the above two methods which one is better?and tel me why?
if second one is better means what about the cpu usage(when i go for more objects)
Regards
Nags
Comment