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.

How to qualify methods as static in Scala?

I have a class class MyClass { def apply(myRDD: RDD[String]) { val rdd2 = myRDD.map(myString => { // do String manipulation } } } …

scala static static-methods
Call static method from instance in PHP, future deprecation?

While I understand the $this variable is not available when a method is called in a static context, to assist …

php this static-methods deprecated instance-methods
Write to static field - is FindBugs wrong in this case?

I have a Java class like this: public class Foo { public static int counter = 0; public void bar(int counter) { Foo.…

java static-methods static-members findbugs
super() and @staticmethod interaction

Is super() not meant to be used with staticmethods? When I try something like class First(object): @staticmethod def getlist(): …

python python-2.7 static-methods super
HttpContext.Current.Response inside a static method

I have the following static method inside a static class. My question is it safe to use HttpContext.Current.Response …

c# static-methods httpcontext
C# class instance with static method vs static class memory usage

How does C#, or other languages for that matter, handle memory allocation (and memory de-allocation) between these two scenarios: 1.) A …

c# memory-management static-methods
C# interface cannot contain operators

Can anyone please explain why C# interfaces are not allowed to contain operators? Thanks.

c# interface operators static-methods
Why PHP uses static methods in object context?

I have the following code (like, for real, this is my real code) : <?php class Foobar { public static function …

php static-methods magic-methods
Swift calling static methods: type(of: self) vs explicit class name

In swift, an instance func can't call a static/class func without prefixing the method call with the class name. …

swift static-methods
Java Integer.parseInt() Not Working for Large Numbers

I have the following simple piece of code which is intended to detect that a given IPv4 address indeed only …

java class integer static-methods parseint