Home > DeveloperSection > Interviews > Can we call static method with null object?

Posted on    September-02-2015 11:29 PM

 Java Java 
Ratings:
 1 Answer(s)
  479  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Points:4035
Posted on    September-02-2015 11:29 PM

Yes we can call because static method is bound at compile time and only type of variable is used for static binding not the value of object. It’s not a good practice to call static method by instance, always call static method in Java by using class name like Math.max()

Don't want to miss updates? Please click the below button!

Follow MindStick