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();
Wednesday, January 16, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment