Static, and non-static method (simultaneously).

    Date: 08/21/06 (C Sharp)    Keywords: no keywords

    Is it possible to make such a method that you can use like a static or like a non-static method?

    class Class
    {
    public static void method()
    {
    // ...
    }
    }

    and then use it as follows:

    Class instance = new Class();
    instance.method();

    and also be able to use it like this:

    Class.method();

    Probably simple question, but too awkward for a search engine.

    Source: http://community.livejournal.com/csharp/74021.html

« Problem connecting to a... || Attach class to a Session... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home