Error using static
/*
C#: The Complete Reference
by Herbert Schildt
Publisher: Osborne/McGraw-Hill (March 8, 2002)
ISBN: 0072134852
*/
using System;
public class AnotherStaticError {
// non-static method.
void nonStaticMeth() {
Console.WriteLine("Inside nonStaticMeth().");
}
/* Error! Can't directly call a non-static method
from within a static method. */
static void staticMeth() {
nonStaticMeth(); // won't compile
}
}
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
|