I know it's not pure, but Java does force you to think in an object-oriented way. And there are problems where that's an advantage.
I know it's not pure, but Java does force you to think in an object-oriented way. And there are problems where that's an advantage.
The majority of a class's definition is spent defining methods. In Java, methods are not objects.
A large amount of method code is spent looping, branching and exception handling. In Java, loops, branches and exception handlers are not objects.
Scattered liberally throughout all of this, there are type annotations. In Java, types are not objects.
Could you please explain how Java forces me to think in an object-oriented way?
Smalltalk is, since numbers, booleans, etc. are objects, classes are objects, methods (and functions in general, known as "blocks" in Smalltalk parlance) are objects.
Likewise, the only control flow mechanism is the method call. Branching (if/then/else) is a method of the boolean objects. Loops are done via the "times" method of numbers. It's turtles all the way down.