Re: [Vala] access static method



I can not explain why that does not work for me, I have renamed the static method now Nevertheless many thanks...


Am 26.03.19 um 17:26 schrieb Wolfgang Mauer:
namespace MyNamespace {

    public static void static_method () {
        print ("This is the namespace static method\n");
    }

    public class MyClass : Object {

        public static void static_method () {
            print ("This is the class method\n");
        }

        public void some_method () {
            static_method ();
            MyNamespace.static_method ();
            MyNamespace.MyClass.static_method ();
        }


        public static void main () {
            var a = new MyClass ();

            a.some_method ();
        }
    }
}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]