Top "Static-methods" questions

Methods that neither require an instance of the class nor can they implicitly access the data (or this, self, Me, etc.

Is it possible to get the class name from a static method?

Possible Duplicate: Getting the class name from a static method in Java When you are inside of a static method, …

java static-methods classname
Is it possible to specify a static function in a Kotlin interface?

I want to do something like this: interface Serializable<FromType, ToType> { fun serialize(): ToType companion object { abstract fun …

interface static-methods abstract kotlin static-functions
Method overloading and choosing the most specific type

The sample code is : public class OverloadingTest { public static void test(Object obj){ System.out.println("Object called"); } public static …

java static-methods overloading
How to cover a method calling a static method using JUnit mocking?

Consider two classes A and B. class A { static int a(){} } class B { void something(){ int value=A.a(); .......}} Now …

java junit static-methods easymock junit3
Access to static properties via this.constructor in typescript

I want to write es6 class: class SomeClass { static prop = 123 method() { } } How to get access to static prop from method() …

typescript this static-methods static-members typescript1.6
Why is a static method considered a method?

I'm writing an explanation for some code for a course, and have been accidentally using the words method and function …

java methods static static-methods terminology
module with classes with only static methods

I have a Python module that contains a number of classes, each representing a particular physical material with its properties (…

python class design-patterns static-methods
PHP: What if I call a static method in non-static way

I'm not pro in Object Oriented Programming and I got a silly question: class test { public static function doSomething($arg) { $…

php static-methods
Class VERSUS namespace, OR class AND namespace?

Both Class and Namespace? This question is about a pattern that I am seeing myself use more and more: Having …

c++ class namespaces static-methods non-member-functions
How to mock class method (+)?

Need to write unit testing for the following code, I want to do mock for class method canMakePayments, return yes …

objective-c unit-testing mocking static-methods ocmock