14
Reply

These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }

Rajesh Singh

Rajesh Singh

Nov 16, 2015
2.1k
0

    Constructor don't have return type

    Mukesh kumar
    May 08, 2016
    1

    Please see below class A { statc intA() { Correct } static A(int x,int y) { Incorrect } static A(int x) {Incorrect } }Static constructor automatically invoked/called by CLR so access modifer or parameters are not allowed

    Raghvandra Shukla
    March 27, 2016
    1

    static constructor does not contain any parameter or access modifier or return type.

    sushil kumar
    July 20, 2017
    0

    1. Incorrect because static constructor will not have return type 2&3. Incorrect because static constructor must be parameterless

    parvathi somanahalli
    March 18, 2017
    0

    Your class is not static how should you define constructor its compile time error.

    ashish bhui
    October 06, 2016
    0

    Your class is not static it gives you compile time error..

    ashish bhui
    October 06, 2016
    0

    Your class is not static it gives you compile time error..

    ashish bhui
    October 06, 2016
    0

    Your class is not static it gives you compile time error..

    ashish bhui
    October 06, 2016
    0

    Your class is not static it gives you compile time error..

    ashish bhui
    October 06, 2016
    0

    Static constructors should be parameter less

    Mangesh Kulkarni
    July 31, 2016
    0

    Static Constructor must be parameter less

    Mangesh Kulkarni
    July 31, 2016
    0

    Static constructor will automatically be invoked only once. It happens either creation of the first object or accessing its static members. Any way we cannot explicitly invoke the static constructor so access modifer or parameters are not allowed

    vipin kv
    March 10, 2016
    0

    no

    Anil Jha
    March 03, 2016
    0

    A static constructor does not take access modifiers or have parameters.

    Rajesh Singh
    November 16, 2015
    0