Skip to main content
Fixed typo
Source Link
Fabian Steeg
  • 45.9k
  • 7
  • 88
  • 113

You could create an instance of the class you want to call the method on, e.g.

new Foo().staticMethodnonStaticMethod(); 

You could create an instance of the class you want to call the method on, e.g.

new Foo().staticMethod(); 

You could create an instance of the class you want to call the method on, e.g.

new Foo().nonStaticMethod(); 
Source Link
Fabian Steeg
  • 45.9k
  • 7
  • 88
  • 113

You could create an instance of the class you want to call the method on, e.g.

new Foo().staticMethod();