Why static methods cannot access non static variables or methods?5
1020 5b5cc7cce4d2b4197775102f
Q: Why static methods cannot access non static variables or methods?
- Show Answer
- Workspace
- Discuss
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.
Similar Questions
Since Nithya and Suganya exchange places, so Rita’s new position is the same as Monika’s earlier position. This position is 17th from the right and 10th from the left. Therefore Number of girls in the row = (16 + 1 + 9) = 26.