Home » Interview » Technology

Why static methods cannot access non static variables or methods?

Correct Answer: 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

← Previous Question Next Question→

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion