Get Started
898

Q: Why static methods cannot access non static variables or methods?

  • Show Answer
  • Workspace

Answer :
Explanation :

A static method cannot access non static variables or methods because static methods doesnt need the object to be accessed. So if a static method has non static variables or non static methods which has instantiated variables they will no be intialized since the object is not created and this could result in an error.

The Most Comprehensive Exam Preparation Platform

Get the Examsbook Prep App Today