3
Reply

Can we use “this” within a static method?

Pradeep Yadav

Pradeep Yadav

8y
608
1
Reply
    Technically its not possible , because static portion execute before any other part of code o this keyword will be without referenced
    No, this keyword denotes instance variables and functions. In static method, Only static properties initialize.
    No, We can not use, we can only use static variables/methods in a static method.