static-methods

Why aren't static methods considered good OO practice?

I'm reading Programming Scala. At the beginning of chapter 4, the author comments that Java supports static methods, which are "not-so-pure OO concepts." Why is this so? ...

Non-member static templated method definitions in C++?

Can I call a non-member static templated function from a static member function where the definition is split into header and cpp: // zero.cpp class Zero { static void zero() { one(5); } }; // one.h template <typename T> static void one(T& var); // one.cpp template <typename T> void one(T& var) { } // main.cpp ... Zero::zero...

In C++, can I represent a class type as a variable?

I would like to call a static method from a class that I'll determine at run-time, but which I know subclasses a given class. So let's say I have these classes class super { public: super(); static super *loadMe (ifstream &is); } class subA : public super { public: subA(); static super *loadMe (ifstream &is); } c...

Static method returning inner class

I really don't understand why the getMyClass2 method below cannot be static, why isn't it valid Java code? public class MyClass { private class MyClass2 { public String s1 = ""; public String s2 = ""; } private MyClass2 myClass2; private static MyClass2 getMyClass2() { MyClass2 myClass2 ...