I made a class then I recall it but the codes doesn't display
Printable View
I made a class then I recall it but the codes doesn't display
Your code is broken.
the class in the program
public static class message
{
public message()
{
MessageBox.show("welcome to the world of programming");
}
}
and how recalled the class
var c1 = new message
c1.message();
every thing is OK the visual studio 2010 didn't show any kind of errors but when i run the program the message didn't show up
Make your message() static as well. You can't access a non-static method in a static class, even when instantiating it.