• Post Reply Bookmark Topic Watch Topic
  • New Topic

whether Java is 100% OOPS  RSS feed

 
Niyas Ahmed Sheikh
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I want to know whether Java is 100% OOPS Language.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, Java was a big oops

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).
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check my signature.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think the phrase "100% object oriented [anything]" has any reasonable meaning.
 
Niyas Ahmed Sheikh
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is Hybrid OOPS and Pure OOPS? Give one example for each
 
Steve Morrow
Ranch Hand
Posts: 657
Clojure Spring VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is Hybrid OOPS and Pure OOPS? Give one example for each
Sounds like homework. Have you tried Google?

http://www.google.com/search?q=hybrid+object+oriented+programming+language

Hint: look at the first link.
 
Smita Chopra
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it fair to say that Java is not 100% OOPS because it doesn't support Multiple inheritance?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Stan James:
Wow, that first link is a good page.


Agreed.

His rules for what is OO include my favorite: All operations send messages to objects.


My "rule" would be even more rigorous: control statements (such as "if" and "for") are implemented as messages to objects, too.
 
Steven Bell
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Smita Chopra:
Is it fair to say that Java is not 100% OOPS because it doesn't support Multiple inheritance?


I don't think that really plays into the definition of a 'pure OO' language.

I would say Java is a hybrid language while smalltalk would be a 'pure OO' language if such a thing exists.

I would also point out that there is a difference between an OO language and OO code.
 
M Beck
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Steven Bell
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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". ;-)






(I've seen it done, it's scarry)
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you can write OO code in C (without the ++), though it's very hard and error prone.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!