Consider the class below
class joel
{
public int num = 0;
public void displaynum()
{
int num = 1;
}
public void displaynextnum()
{
num = 2;
}
}
What will below codes print and why?
1. joel j = new joel();
j.displaynum();
Console.WriteLine("Display member " + j.num);
Console.ReadKey();
2. joel j = new joel();
j.displaynextnum();
Console.WriteLine("Display member " + j.num);
Console.ReadKey();
Po shfaqen postimet me emërtimin Hiding instance variable. Shfaq të gjitha postimet
Po shfaqen postimet me emërtimin Hiding instance variable. Shfaq të gjitha postimet
e martë, 15 janar 2008
Abonohu te:
Postimet (Atom)