3
Reply

Can we use “this” within a static method?

Pradeep Yadav

Pradeep Yadav

May 24, 2017
513
1

    Technically its not possible , because static portion execute before any other part of code o this keyword will be without referenced

    Manav Pandya
    January 16, 2018
    0

    No, this keyword denotes instance variables and functions. In static method, Only static properties initialize.

    Kapil Gupta
    November 21, 2017
    0

    No, We can not use, we can only use static variables/methods in a static method.

    Pradeep Yadav
    May 24, 2017
    0