Styrow.dev
Question 126 of 247
Java Topic: General medium

Can a local class declared inside a static method have access to the instance members of the outer class?

Question

Can a local class declared inside a static method have access to the instance members of the outer class?

Answer

No. There is no this reference available in the static method .The static method class can not have access to any members of the outer class other than static members.