Why won't this code work?
using
System;using
System.Windows.Forms;namespace
PracticeC#
{
class Practice
{
public static void Main()
{
// declare and assign a string variable called human
string human;
human = "Walking & talking life";
// declare and assign an int variable called mind
int mind;
mind = 100;
// Print the value of the variables to the console
Console.WriteLine(mind);
Console.WriteLine(human);
}
}
class Continued
{
public static void notMain()
{
MessageBox.Show(human);
MessageBox.Show(mind);
}
}
}
ahmed ali9 pointsPosted Apr 18, 2006, 1:22 PM EDT
u can try in this manner the inharitance
using System;
using System.Windows.Forms;
namespace Practice
{
class Practice
{
// declare and assign a string variable called human
public string human;
public int mind;
public Practice()
{
human = "Walking & talking life";
// declare and assign an int variable called mind
mind = 100;
// Print the value of the variables to the console
Console.WriteLine(mind);
Console.WriteLine(human);
}
}
class Continue:Practice
{
public static void Main()
{
Practice a = new Practice();
MessageBox.Show(a.human);
}
}
}