Home / Questions / What are the restriction imposed on a static method or a static block of code?
Explanatory Question

What are the restriction imposed on a static method or a static block of code?

👁 1,109 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

A static method should not refer to instance variables without creating an instance and cannot use "this" operator to refer the instance.