|
|
|
|
|
by chrisseaton
2792 days ago
|
|
I think what you mean is that classes are referenced by a separate namespace in Java and aren’t in Ruby. That’s completely orthogonal to whether they’re objects or not. You can keep fiction and non-fiction in separate bookshelves if you want but when you get either off the shelf it’s still a book. |
|
In languages I'm used to, an object is a type of value, and values are things that you can store in (or refer to with) variables.
The only vaguely object-like feature of Java classes I can think of is that you can look up (static) methods/attributes on them with a dot.
Or is there more? You can't call `String.toString()`, so `String` isn't an instance of something that inherits from `Object`. I'm at a bit of a loss here... There obviously exist "class objects", but they're not normally what people refer to when they talk about classes. I'd say Java classes are almost purely lexical constructs (though I could be wrong there -- again, I don't know much about Java...)