Skip to main content
added 2 characters in body
Source Link
luisZavaleta
  • 1.2k
  • 12
  • 21

Static methods don't depends on the instance, they belong to the class and only to the class, in fact if you have a static method you'll always access to one unique instance always.

 myObject.foo(5) 

is only a shortcut, what you really are doing is

 SubClassSuperClass.foo(5) 

Static methods don't depends on the instance, they belong to the class and only to the class, in fact if you have a static method you'll always access to one unique instance always.

 myObject.foo(5) 

is only a shortcut, what you really are doing is

 SubClass.foo(5) 

Static methods don't depends on the instance, they belong to the class and only to the class, in fact if you have a static method you'll always access to one unique instance always.

 myObject.foo(5) 

is only a shortcut, what you really are doing is

 SuperClass.foo(5) 
added 21 characters in body
Source Link
luisZavaleta
  • 1.2k
  • 12
  • 21

Static methods don't depends on the instance, they belong to the class and only to the class, in fact if you have a static method you'll always access to one unique instance always. myObject.foo(5)

 myObject.foo(5) 

is only a shortcut, what you really are doing is SubClass.foo(5)

 SubClass.foo(5) 

Static methods don't depends on the instance, they belong to the class and only to the class, in fact if you have a static method you'll always access to one unique instance always. myObject.foo(5) is only a shortcut, what you really are doing is SubClass.foo(5)

Static methods don't depends on the instance, they belong to the class and only to the class, in fact if you have a static method you'll always access to one unique instance always.

 myObject.foo(5) 

is only a shortcut, what you really are doing is

 SubClass.foo(5) 
Source Link
luisZavaleta
  • 1.2k
  • 12
  • 21

Static methods don't depends on the instance, they belong to the class and only to the class, in fact if you have a static method you'll always access to one unique instance always. myObject.foo(5) is only a shortcut, what you really are doing is SubClass.foo(5)