Can you access instance properties from a static method?

  • Yes, using the this keyword.
  • No, it results in a runtime error.
  • Yes, using the super keyword.
  • No, instance properties are inaccessible.
No, you cannot access instance properties directly from a static method. Static methods are associated with the class itself and do not have access to instance-specific data. Option D is correct.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *