Java supports OOP programming (inheritance, polymorphism etc.), but the code you write can be procedural or even functional in style. You can choose to use the OOP elements, or you can choose to ignore them.
Java has primitive data types and static methods and data members (which effectively make programming without OO principles possible), therefore isn't strictly OO (though one can always elect to not use any of those features of course).
Wow, that first link is a good page. Just skimming right now, but it looks very sensible. His rules for what is OO include my favorite: All operations send messages to objects. I'm sorry the Java community didn't pick up the "message passing" terminology to describe the language.
it's kindof hard to completely ignore Java's OO features when you have to write all your code in classes, and explicitly type your "main" as "public static". ;-)
what exactly is "OO" will likely be debated forever. i like this summary of things people usually want in an "OO language", for a quick reference; note item 6, which has been brought up in this thread already. personally, i'm fond of items 5 and 3.
the language comparison that's been referred to here seems out of date. i know recent Python versions no longer use reference counting alone in their garbage collector, for example, and the column for Visual Basic is not talking about VB.NET, which is a quite different language from pre-dotnet versions. it's a good starting point, but i suspect no comparison of this sort can ever be kept very well up to date as there is simply too much change to track in too many different environments.
the worst flaw with that comparison seems to be that it apparently takes the Capers Jones language level study seriously. that latter study ranks "languages" such as HTML, Excel, shell scripts, and COBOL on a single linear scale... and ranks HTML higher than (for example) Lisp. i'm sorry, but anyone who thinks that is more than a bad joke frankly brings their own judgement into question.
Originally posted by M Beck: it's kindof hard to completely ignore Java's OO features when you have to write all your code in classes, and explicitly type your "main" as "public static". ;-)
To the original question ... if we said Smaltalk == 1.0 OO and Java = 0.873 OO what would we do with that information?
And a Huzzah to Steven for pointing out that we can talk separately about OO languages and OO coding. Java gives you the tools to do relatively good things, and the rope to hang yourself.
When I was first getting some exposure to OOP in Byte and other magazines, IBM said they had done a complete redesign of CICS internals with an OO design and a 370 assembler and PLI implementation. I always liked that idea. It's all assembler at some point, isn't it? (Ok, I don't mean that too seriously.) Mostly they hid a lot of data structures that had been public behind new APIs. A good idea whether it was very OO or not.
Post by:autobot
Everybody's invited. Except this tiny ad:
a bit of art, as a gift, that will fit in a stocking